pub struct SortByKey<S, F>{ /* private fields */ }
Expand description
A VectorDiff
stream adapter that presents a sorted view of the
underlying ObservableVector
items.
Sorting is done by transforming items to a key with a custom function
and comparing those. Otherwise this adapter works exactly like Sort
,
see that type’s documentation for details on how this adapter operates.
Implementations§
Source§impl<S, F, K> SortByKey<S, F>where
S: Stream,
S::Item: VectorDiffContainer,
F: Fn(&VectorDiffContainerStreamElement<S>) -> K,
K: Ord,
impl<S, F, K> SortByKey<S, F>where
S: Stream,
S::Item: VectorDiffContainer,
F: Fn(&VectorDiffContainerStreamElement<S>) -> K,
K: Ord,
Sourcepub fn new(
initial_values: Vector<VectorDiffContainerStreamElement<S>>,
inner_stream: S,
key_fn: F,
) -> (Vector<VectorDiffContainerStreamElement<S>>, Self)
pub fn new( initial_values: Vector<VectorDiffContainerStreamElement<S>>, inner_stream: S, key_fn: F, ) -> (Vector<VectorDiffContainerStreamElement<S>>, Self)
Create a new SortByKey
with the given (unsorted) initial values,
stream of VectorDiff
updates for those values, and the key function.
Trait Implementations§
Source§impl<S, F, K> Stream for SortByKey<S, F>where
S: Stream,
S::Item: VectorDiffContainer,
F: Fn(&VectorDiffContainerStreamElement<S>) -> K,
K: Ord,
impl<S, F, K> Stream for SortByKey<S, F>where
S: Stream,
S::Item: VectorDiffContainer,
F: Fn(&VectorDiffContainerStreamElement<S>) -> K,
K: Ord,
impl<'__pin, S, F> Unpin for SortByKey<S, F>
Auto Trait Implementations§
impl<S, F> Freeze for SortByKey<S, F>
impl<S, F> RefUnwindSafe for SortByKey<S, F>where
<S as Stream>::Item: Sized,
F: RefUnwindSafe,
S: RefUnwindSafe,
<<S as Stream>::Item as VectorDiffContainerOps<<<S as Stream>::Item as VectorDiffContainer>::Element>>::SortBuf: RefUnwindSafe,
<<S as Stream>::Item as VectorDiffContainer>::Element: RefUnwindSafe,
impl<S, F> Send for SortByKey<S, F>
impl<S, F> Sync for SortByKey<S, F>
impl<S, F> UnwindSafe for SortByKey<S, F>where
<S as Stream>::Item: Sized,
F: UnwindSafe,
S: UnwindSafe,
<<S as Stream>::Item as VectorDiffContainerOps<<<S as Stream>::Item as VectorDiffContainer>::Element>>::SortBuf: UnwindSafe,
<<S as Stream>::Item as VectorDiffContainer>::Element: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more