eyeball_im_util::vector

Trait VectorObserverExt

Source
pub trait VectorObserverExt<T>: VectorObserver<T>
where T: Clone + 'static, <Self::Stream as Stream>::Item: VectorDiffContainer<Element = T>,
{
Show 14 methods // Provided methods fn filter<F>(self, f: F) -> (Vector<T>, Filter<Self::Stream, F>) where F: Fn(&T) -> bool { ... } fn filter_map<U, F>(self, f: F) -> (Vector<U>, FilterMap<Self::Stream, F>) where U: Clone, F: Fn(T) -> Option<U> { ... } fn head( self, limit: usize, ) -> (Vector<T>, Head<Self::Stream, EmptyLimitStream>) { ... } fn dynamic_head<L>(self, limit_stream: L) -> Head<Self::Stream, L> where L: Stream<Item = usize> { ... } fn dynamic_head_with_initial_value<L>( self, initial_limit: usize, limit_stream: L, ) -> (Vector<T>, Head<Self::Stream, L>) where L: Stream<Item = usize> { ... } fn tail( self, limit: usize, ) -> (Vector<T>, Tail<Self::Stream, EmptyLimitStream>) { ... } fn dynamic_tail<L>(self, limit_stream: L) -> Tail<Self::Stream, L> where L: Stream<Item = usize> { ... } fn dynamic_tail_with_initial_value<L>( self, initial_limit: usize, limit_stream: L, ) -> (Vector<T>, Tail<Self::Stream, L>) where L: Stream<Item = usize> { ... } fn skip( self, count: usize, ) -> (Vector<T>, Skip<Self::Stream, EmptyCountStream>) { ... } fn dynamic_skip<C>(self, count_stream: C) -> Skip<Self::Stream, C> where C: Stream<Item = usize> { ... } fn dynamic_skip_with_initial_count<C>( self, initial_count: usize, count_stream: C, ) -> (Vector<T>, Skip<Self::Stream, C>) where C: Stream<Item = usize> { ... } fn sort(self) -> (Vector<T>, Sort<Self::Stream>) where T: Ord { ... } fn sort_by<F>(self, compare: F) -> (Vector<T>, SortBy<Self::Stream, F>) where F: Fn(&T, &T) -> Ordering { ... } fn sort_by_key<F, K>( self, key_fn: F, ) -> (Vector<T>, SortByKey<Self::Stream, F>) where F: Fn(&T) -> K, K: Ord { ... }
}
Expand description

Convenience methods for VectorObservers.

See that trait for which types implement this.

Provided Methods§

Source

fn filter<F>(self, f: F) -> (Vector<T>, Filter<Self::Stream, F>)
where F: Fn(&T) -> bool,

Filter the vector’s values with the given function.

Source

fn filter_map<U, F>(self, f: F) -> (Vector<U>, FilterMap<Self::Stream, F>)
where U: Clone, F: Fn(T) -> Option<U>,

Filter and map the vector’s values with the given function.

Source

fn head(self, limit: usize) -> (Vector<T>, Head<Self::Stream, EmptyLimitStream>)

Limit the observed values to the first limit values.

See Head for more details.

Source

fn dynamic_head<L>(self, limit_stream: L) -> Head<Self::Stream, L>
where L: Stream<Item = usize>,

Limit the first observed values to a number of values determined by the given stream.

See Head for more details.

Source

fn dynamic_head_with_initial_value<L>( self, initial_limit: usize, limit_stream: L, ) -> (Vector<T>, Head<Self::Stream, L>)
where L: Stream<Item = usize>,

Limit the first observed values to initial_limit values initially, and update the limit with the value from the given stream.

See Head for more details.

Source

fn tail(self, limit: usize) -> (Vector<T>, Tail<Self::Stream, EmptyLimitStream>)

Limit the observed values to the last limit values.

See Tail for more details.

Source

fn dynamic_tail<L>(self, limit_stream: L) -> Tail<Self::Stream, L>
where L: Stream<Item = usize>,

Limit the last observed values to a number of items determined by the given stream.

See Tail for more details.

Source

fn dynamic_tail_with_initial_value<L>( self, initial_limit: usize, limit_stream: L, ) -> (Vector<T>, Tail<Self::Stream, L>)
where L: Stream<Item = usize>,

Limit the last observed values to initial_limit items initially, and update the limit with the value from the given stream.

See Tail for more details.

Source

fn skip(self, count: usize) -> (Vector<T>, Skip<Self::Stream, EmptyCountStream>)

Skip the first count observed values.

See Skip for more details.

Source

fn dynamic_skip<C>(self, count_stream: C) -> Skip<Self::Stream, C>
where C: Stream<Item = usize>,

Skip the first count observed values, where count is determined by the given stream.

See Skip for more details.

Source

fn dynamic_skip_with_initial_count<C>( self, initial_count: usize, count_stream: C, ) -> (Vector<T>, Skip<Self::Stream, C>)
where C: Stream<Item = usize>,

Skip the first initial_count observed values, and update the count with the values from the given stream.

See Skip for more details.

Source

fn sort(self) -> (Vector<T>, Sort<Self::Stream>)
where T: Ord,

Sort the observed values.

See Sort for more details.

Source

fn sort_by<F>(self, compare: F) -> (Vector<T>, SortBy<Self::Stream, F>)
where F: Fn(&T, &T) -> Ordering,

Sort the observed values with the given comparison function.

See SortBy for more details.

Source

fn sort_by_key<F, K>(self, key_fn: F) -> (Vector<T>, SortByKey<Self::Stream, F>)
where F: Fn(&T) -> K, K: Ord,

Sort the observed values with the given key function.

See SortBy for more details.

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<T, O> VectorObserverExt<T> for O
where T: Clone + 'static, O: VectorObserver<T>, <Self::Stream as Stream>::Item: VectorDiffContainer<Element = T>,