pub trait Tools<Item>{
// Required methods
fn counts(self) -> impl Future<Output = HashMap<Item, usize>> + Send
where <Self as Stream>::Item: Eq + Hash;
fn counts_by<K, F>(
self,
f: F,
) -> impl Future<Output = HashMap<K, usize>> + Send
where F: Fn(Item) -> K + Send,
K: Eq + Hash + Send;
fn counts_by_with_cap<const CAP: usize, K, F>(
self,
f: F,
) -> impl Future<Output = HashMap<K, usize>> + Send
where F: Fn(Item) -> K + Send,
K: Eq + Hash + Send;
fn counts_with_cap<const CAP: usize>(
self,
) -> impl Future<Output = HashMap<Item, usize>> + Send
where <Self as Stream>::Item: Eq + Hash;
fn fold_default<T, F, Fut>(self, f: F) -> impl Future<Output = T> + Send
where F: Fn(T, Item) -> Fut + Send,
Fut: Future<Output = T> + Send,
T: Default + Send;
}Expand description
StreamTools
This interface is not necessarily complete; feel free to add as-needed.
Required Methods§
fn counts(self) -> impl Future<Output = HashMap<Item, usize>> + Send
fn counts_by<K, F>(self, f: F) -> impl Future<Output = HashMap<K, usize>> + Send
fn counts_by_with_cap<const CAP: usize, K, F>( self, f: F, ) -> impl Future<Output = HashMap<K, usize>> + Send
fn counts_with_cap<const CAP: usize>( self, ) -> impl Future<Output = HashMap<Item, usize>> + Send
fn fold_default<T, F, Fut>(self, f: F) -> impl Future<Output = T> + Send
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.