pub struct Sorted<C>(/* private fields */);Expand description
Struct to represent a sorted collection.
Implementations§
Source§impl<C> Sorted<C>
impl<C> Sorted<C>
Sourcepub const fn new_unchecked(col: C) -> Self
pub const fn new_unchecked(col: C) -> Self
Creates a sorted collection without checking if it is sorted.
As unsorted collection will not create UB but will probably panic at some point, such this function is still safe, even if an unsorted collection is given.
Trait Implementations§
Source§impl<C> Chain for Sorted<C>where
C: Chain,
impl<C> Chain for Sorted<C>where
C: Chain,
Source§fn len(&self) -> usize
fn len(&self) -> usize
Returns the minimum amount of elements the signal can create. Read more
Source§fn first(&self) -> Option<Self::Output>
fn first(&self) -> Option<Self::Output>
Returns the first element of the signal, or
None if it is empty.Source§fn last(&self) -> Option<Self::Output>
fn last(&self) -> Option<Self::Output>
Returns the last element of the signal, or
None if it is empty.Source§impl<C> Signal<usize> for Sorted<C>
impl<C> Signal<usize> for Sorted<C>
Source§fn eval(&self, input: usize) -> Self::Output
fn eval(&self, input: usize) -> Self::Output
Method to generate the element at the given input
Source§fn extract<I, J>(self, iterator: I) -> Extract<Self, J> ⓘ
fn extract<I, J>(self, iterator: I) -> Extract<Self, J> ⓘ
Helper function if one wants to extract values from the interpolation. Read more
Source§fn stack<G>(self, signal: G) -> Stack<Self, G>where
Self: Sized,
fn stack<G>(self, signal: G) -> Stack<Self, G>where
Self: Sized,
Stack two signals together Read more
Source§impl<C: Chain> SortedChain for Sorted<C>
impl<C: Chain> SortedChain for Sorted<C>
Source§fn strict_upper_bound_clamped(
&self,
element: Self::Output,
min: usize,
max: usize,
) -> usize
fn strict_upper_bound_clamped( &self, element: Self::Output, min: usize, max: usize, ) -> usize
Returns the smallest index between
min and max
for which the corresponding element is bigger then the input.
If all elements are smaller, this function will return the given maximum. Read moreSource§fn strict_upper_bound(&self, element: Self::Output) -> usize
fn strict_upper_bound(&self, element: Self::Output) -> usize
Returns the smallest index for which the corresponding element is bigger then the input.
If all elements are bigger, this function will return self.len(). Read more
Source§fn upper_border(&self, element: Self::Output) -> (usize, usize, Self::Output)
fn upper_border(&self, element: Self::Output) -> (usize, usize, Self::Output)
Find the values inside the collection for which the given element is inbetween
and a linear factor at how close it is to which value. Read more
impl<C: Copy> Copy for Sorted<C>
impl<C> StructuralPartialEq for Sorted<C>
Auto Trait Implementations§
impl<C> Freeze for Sorted<C>where
C: Freeze,
impl<C> RefUnwindSafe for Sorted<C>where
C: RefUnwindSafe,
impl<C> Send for Sorted<C>where
C: Send,
impl<C> Sync for Sorted<C>where
C: Sync,
impl<C> Unpin for Sorted<C>where
C: Unpin,
impl<C> UnwindSafe for Sorted<C>where
C: UnwindSafe,
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