pub trait VectorObserverExt<T>: VectorObserver<T>{
// 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 limit(
self,
limit: usize,
) -> (Vector<T>, Limit<Self::Stream, EmptyLimitStream>) { ... }
fn dynamic_limit<L>(self, limit_stream: L) -> Limit<Self::Stream, L>
where L: Stream<Item = usize> { ... }
fn dynamic_limit_with_initial_value<L>(
self,
initial_limit: usize,
limit_stream: L,
) -> (Vector<T>, Limit<Self::Stream, L>)
where L: 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 VectorObserver
s.
See that trait for which types implement this.
Provided Methods§
Sourcefn filter<F>(self, f: F) -> (Vector<T>, Filter<Self::Stream, F>)
fn filter<F>(self, f: F) -> (Vector<T>, Filter<Self::Stream, F>)
Filter the vector’s values with the given function.
Sourcefn filter_map<U, F>(self, f: F) -> (Vector<U>, FilterMap<Self::Stream, F>)
fn filter_map<U, F>(self, f: F) -> (Vector<U>, FilterMap<Self::Stream, F>)
Filter and map the vector’s values with the given function.
Sourcefn limit(
self,
limit: usize,
) -> (Vector<T>, Limit<Self::Stream, EmptyLimitStream>)
fn limit( self, limit: usize, ) -> (Vector<T>, Limit<Self::Stream, EmptyLimitStream>)
Limit the observed values to limit
.
See Limit
for more details.
Sourcefn dynamic_limit<L>(self, limit_stream: L) -> Limit<Self::Stream, L>
fn dynamic_limit<L>(self, limit_stream: L) -> Limit<Self::Stream, L>
Limit the observed values to a number of items determined by the given stream.
See Limit
for more details.
Sourcefn dynamic_limit_with_initial_value<L>(
self,
initial_limit: usize,
limit_stream: L,
) -> (Vector<T>, Limit<Self::Stream, L>)
fn dynamic_limit_with_initial_value<L>( self, initial_limit: usize, limit_stream: L, ) -> (Vector<T>, Limit<Self::Stream, L>)
Limit the observed values to initial_limit
items initially, and update
the limit with the value from the given stream.
See Limit
for more details.
Sourcefn sort(self) -> (Vector<T>, Sort<Self::Stream>)where
T: Ord,
fn sort(self) -> (Vector<T>, Sort<Self::Stream>)where
T: Ord,
Sort the observed values.
See Sort
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.