pub struct ReverseSpan<S>(pub S);
Expand description
A splitablespan in reverse. This is useful for making lists in descending order.
Tuple Fields§
§0: S
Trait Implementations§
Source§impl<S> Clone for ReverseSpan<S>where
S: Clone,
impl<S> Clone for ReverseSpan<S>where
S: Clone,
Source§fn clone(&self) -> ReverseSpan<S>
fn clone(&self) -> ReverseSpan<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<S> Debug for ReverseSpan<S>where
S: Debug,
impl<S> Debug for ReverseSpan<S>where
S: Debug,
Source§impl<S> Default for ReverseSpan<S>where
S: Default,
impl<S> Default for ReverseSpan<S>where
S: Default,
Source§fn default() -> ReverseSpan<S>
fn default() -> ReverseSpan<S>
Returns the “default value” for a type. Read more
Source§impl<S> HasLength for ReverseSpan<S>where
S: HasLength,
impl<S> HasLength for ReverseSpan<S>where
S: HasLength,
Source§impl<S> Hash for ReverseSpan<S>where
S: Hash,
impl<S> Hash for ReverseSpan<S>where
S: Hash,
Source§impl<S> MergableSpan for ReverseSpan<S>where
S: MergableSpan,
impl<S> MergableSpan for ReverseSpan<S>where
S: MergableSpan,
Source§fn can_append(&self, other: &ReverseSpan<S>) -> bool
fn can_append(&self, other: &ReverseSpan<S>) -> bool
See if the other item can be appended to self.
can_append
will always be called
immediately before append
.Source§fn append(&mut self, other: ReverseSpan<S>)
fn append(&mut self, other: ReverseSpan<S>)
Merge the passed item into self. Essentially, self = self + other. Read more
Source§fn prepend(&mut self, other: ReverseSpan<S>)
fn prepend(&mut self, other: ReverseSpan<S>)
Append an item at the start of this item. self = other + self. Read more
Source§impl<S> PartialEq for ReverseSpan<S>where
S: PartialEq,
impl<S> PartialEq for ReverseSpan<S>where
S: PartialEq,
Source§impl<S> SplitableSpanCtx for ReverseSpan<S>where
S: SplitableSpanCtx<Ctx = ()>,
impl<S> SplitableSpanCtx for ReverseSpan<S>where
S: SplitableSpanCtx<Ctx = ()>,
type Ctx = ()
Source§fn truncate_ctx(
&mut self,
at: usize,
_ctx: &<ReverseSpan<S> as SplitableSpanCtx>::Ctx,
) -> ReverseSpan<S>
fn truncate_ctx( &mut self, at: usize, _ctx: &<ReverseSpan<S> as SplitableSpanCtx>::Ctx, ) -> ReverseSpan<S>
Split the entry, returning the part of the entry which was jettisoned. After truncating at
pos
, self.len() == pos
and the returned value contains the rest of the items. Read moreSource§fn truncate_keeping_right_ctx(
&mut self,
at: usize,
_ctx: &<ReverseSpan<S> as SplitableSpanCtx>::Ctx,
) -> ReverseSpan<S>
fn truncate_keeping_right_ctx( &mut self, at: usize, _ctx: &<ReverseSpan<S> as SplitableSpanCtx>::Ctx, ) -> ReverseSpan<S>
The inverse of truncate. This method mutably truncates an item, keeping all content from
at..item.len() and returning the item range from 0..at.
fn split_ctx(self, at: usize, ctx: &Self::Ctx) -> (Self, Self)
impl<S> Copy for ReverseSpan<S>where
S: Copy,
impl<S> Eq for ReverseSpan<S>where
S: Eq,
impl<S> StructuralPartialEq for ReverseSpan<S>
Auto Trait Implementations§
impl<S> Freeze for ReverseSpan<S>where
S: Freeze,
impl<S> RefUnwindSafe for ReverseSpan<S>where
S: RefUnwindSafe,
impl<S> Send for ReverseSpan<S>where
S: Send,
impl<S> Sync for ReverseSpan<S>where
S: Sync,
impl<S> Unpin for ReverseSpan<S>where
S: Unpin,
impl<S> UnwindSafe for ReverseSpan<S>where
S: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SplitableSpan for Twhere
T: SplitableSpanCtx<Ctx = ()>,
impl<T> SplitableSpan for Twhere
T: SplitableSpanCtx<Ctx = ()>,
Source§fn truncate(&mut self, at: usize) -> Self
fn truncate(&mut self, at: usize) -> Self
Split the entry, returning the part of the entry which was jettisoned. After truncating at
pos
, self.len() == pos
and the returned value contains the rest of the items. Read moreSource§fn truncate_keeping_right(&mut self, at: usize) -> Self
fn truncate_keeping_right(&mut self, at: usize) -> Self
The inverse of truncate. This method mutably truncates an item, keeping all content from
at..item.len() and returning the item range from 0..at.