pub trait ReadyExt<Item>where
Self: Stream<Item = Item> + Sized,{
Show 13 methods
// Required methods
fn ready_all<F>(
self,
f: F,
) -> All<Self, Ready<bool>, impl FnMut(Item) -> Ready<bool>>
where F: Fn(Item) -> bool;
fn ready_any<F>(
self,
f: F,
) -> Any<Self, Ready<bool>, impl FnMut(Item) -> Ready<bool>>
where F: Fn(Item) -> bool;
fn ready_find<'a, F>(
self,
f: F,
) -> impl Future<Output = Option<Item>> + Send
where Self: Send + Unpin + 'a,
F: Fn(&Item) -> bool + Send + 'a,
Item: Send;
fn ready_find_map<'a, F, U>(
self,
f: F,
) -> impl Future<Output = Option<U>> + Send
where Self: Send + Unpin + 'a,
F: Fn(Item) -> Option<U> + Send + 'a,
Item: Send,
U: Send;
fn ready_filter<'a, F>(
self,
f: F,
) -> Filter<Self, Ready<bool>, impl FnMut(&Item) -> Ready<bool> + 'a>
where F: Fn(&Item) -> bool + 'a;
fn ready_filter_map<F, U>(
self,
f: F,
) -> FilterMap<Self, Ready<Option<U>>, impl FnMut(Item) -> Ready<Option<U>>>
where F: Fn(Item) -> Option<U>;
fn ready_fold<T, F>(
self,
init: T,
f: F,
) -> Fold<Self, Ready<T>, T, impl FnMut(T, Item) -> Ready<T>>
where F: Fn(T, Item) -> T;
fn ready_fold_default<T, F>(
self,
f: F,
) -> Fold<Self, Ready<T>, T, impl FnMut(T, Item) -> Ready<T>>
where F: Fn(T, Item) -> T,
T: Default;
fn ready_for_each<F>(
self,
f: F,
) -> ForEach<Self, Ready<()>, impl FnMut(Item) -> Ready<()>>
where F: FnMut(Item);
fn ready_take_while<'a, F>(
self,
f: F,
) -> TakeWhile<Self, Ready<bool>, impl FnMut(&Item) -> Ready<bool> + 'a>
where F: Fn(&Item) -> bool + 'a;
fn ready_scan<B, T, F>(
self,
init: T,
f: F,
) -> Scan<Self, T, Ready<Option<B>>, impl FnMut(&mut T, Item) -> Ready<Option<B>>>
where F: Fn(&mut T, Item) -> Option<B>;
fn ready_scan_each<T, F>(
self,
init: T,
f: F,
) -> Scan<Self, T, Ready<Option<Item>>, impl FnMut(&mut T, Item) -> Ready<Option<Item>>>
where F: Fn(&mut T, &Item);
fn ready_skip_while<'a, F>(
self,
f: F,
) -> SkipWhile<Self, Ready<bool>, impl FnMut(&Item) -> Ready<bool> + 'a>
where F: Fn(&Item) -> bool + 'a;
}Expand description
Synchronous combinators to augment futures::StreamExt. Most Stream combinators take asynchronous arguments, but often only simple predicates are required to steer a Stream like an Iterator. This suite provides a convenience to reduce boilerplate by de-cluttering non-async predicates.
This interface is not necessarily complete; feel free to add as-needed.
Required Methods§
fn ready_all<F>( self, f: F, ) -> All<Self, Ready<bool>, impl FnMut(Item) -> Ready<bool>>
fn ready_any<F>( self, f: F, ) -> Any<Self, Ready<bool>, impl FnMut(Item) -> Ready<bool>>
fn ready_find<'a, F>(self, f: F) -> impl Future<Output = Option<Item>> + Send
fn ready_find_map<'a, F, U>( self, f: F, ) -> impl Future<Output = Option<U>> + Send
fn ready_filter<'a, F>( self, f: F, ) -> Filter<Self, Ready<bool>, impl FnMut(&Item) -> Ready<bool> + 'a>
fn ready_filter_map<F, U>( self, f: F, ) -> FilterMap<Self, Ready<Option<U>>, impl FnMut(Item) -> Ready<Option<U>>>
fn ready_fold<T, F>(
self,
init: T,
f: F,
) -> Fold<Self, Ready<T>, T, impl FnMut(T, Item) -> Ready<T>>where
F: Fn(T, Item) -> T,
fn ready_fold_default<T, F>( self, f: F, ) -> Fold<Self, Ready<T>, T, impl FnMut(T, Item) -> Ready<T>>
fn ready_for_each<F>(
self,
f: F,
) -> ForEach<Self, Ready<()>, impl FnMut(Item) -> Ready<()>>where
F: FnMut(Item),
fn ready_take_while<'a, F>( self, f: F, ) -> TakeWhile<Self, Ready<bool>, impl FnMut(&Item) -> Ready<bool> + 'a>
fn ready_scan<B, T, F>( self, init: T, f: F, ) -> Scan<Self, T, Ready<Option<B>>, impl FnMut(&mut T, Item) -> Ready<Option<B>>>
fn ready_scan_each<T, F>( self, init: T, f: F, ) -> Scan<Self, T, Ready<Option<Item>>, impl FnMut(&mut T, Item) -> Ready<Option<Item>>>
fn ready_skip_while<'a, F>( self, f: F, ) -> SkipWhile<Self, Ready<bool>, impl FnMut(&Item) -> Ready<bool> + 'a>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.