diff options
Diffstat (limited to 'twitch_api/src/sync/waiter.rs')
-rw-r--r-- | twitch_api/src/sync/waiter.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/twitch_api/src/sync/waiter.rs b/twitch_api/src/sync/waiter.rs new file mode 100644 index 0000000..1005e3d --- /dev/null +++ b/twitch_api/src/sync/waiter.rs @@ -0,0 +1,12 @@ +use futures::Future; +use futures::future::{Shared, SharedError}; +use crate::error::ConditionError; + +pub trait Waiter { + type Item: Default; + type Error: From<SharedError<ConditionError>>; + + fn blocked(&self) -> bool; + fn condition(&self) + -> Shared<Box<Future<Item=(), Error=ConditionError> + Send>>; +} |