pub struct SortBy<S, F>{ /* private fields */ }
Expand description
A VectorDiff
stream adapter that presents a sorted view of the
underlying ObservableVector
items.
Sorting is done using a custom comparison function. Otherwise this
adapter works exactly like Sort
, see that type’s documentation for
details on how this adapter operates.
Implementations§
Source§impl<S, F> SortBy<S, F>where
S: Stream,
S::Item: VectorDiffContainer,
F: Fn(&VectorDiffContainerStreamElement<S>, &VectorDiffContainerStreamElement<S>) -> Ordering,
impl<S, F> SortBy<S, F>where
S: Stream,
S::Item: VectorDiffContainer,
F: Fn(&VectorDiffContainerStreamElement<S>, &VectorDiffContainerStreamElement<S>) -> Ordering,
Sourcepub fn new(
initial_values: Vector<VectorDiffContainerStreamElement<S>>,
inner_stream: S,
compare: F,
) -> (Vector<VectorDiffContainerStreamElement<S>>, Self)
pub fn new( initial_values: Vector<VectorDiffContainerStreamElement<S>>, inner_stream: S, compare: F, ) -> (Vector<VectorDiffContainerStreamElement<S>>, Self)
Create a new SortBy
with the given (unsorted) initial values, stream
of VectorDiff
updates for those values, and the comparison function.
Trait Implementations§
Source§impl<S, F> Stream for SortBy<S, F>where
S: Stream,
S::Item: VectorDiffContainer,
F: Fn(&VectorDiffContainerStreamElement<S>, &VectorDiffContainerStreamElement<S>) -> Ordering,
impl<S, F> Stream for SortBy<S, F>where
S: Stream,
S::Item: VectorDiffContainer,
F: Fn(&VectorDiffContainerStreamElement<S>, &VectorDiffContainerStreamElement<S>) -> Ordering,
impl<'__pin, S, F> Unpin for SortBy<S, F>
Auto Trait Implementations§
impl<S, F> Freeze for SortBy<S, F>
impl<S, F> RefUnwindSafe for SortBy<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 SortBy<S, F>
impl<S, F> Sync for SortBy<S, F>
impl<S, F> UnwindSafe for SortBy<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