Skip to main content

Tools

Trait Tools 

Source
pub trait Tools<Item>
where Self: Stream<Item = Item> + Send + Sized, <Self as Stream>::Item: Send,
{ // 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§

Source

fn counts(self) -> impl Future<Output = HashMap<Item, usize>> + Send
where <Self as Stream>::Item: Eq + Hash,

Source

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,

Source

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,

Source

fn counts_with_cap<const CAP: usize>( self, ) -> impl Future<Output = HashMap<Item, usize>> + Send
where <Self as Stream>::Item: Eq + Hash,

Source

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,

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.

Implementors§

Source§

impl<Item, S> Tools<Item> for S
where S: Stream<Item = Item> + Send + Sized, <Self as Stream>::Item: Send,