Struct ReverseSpan

Source
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,

Source§

fn clone(&self) -> ReverseSpan<S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S> Debug for ReverseSpan<S>
where S: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<S> Default for ReverseSpan<S>
where S: Default,

Source§

fn default() -> ReverseSpan<S>

Returns the “default value” for a type. Read more
Source§

impl<S> HasLength for ReverseSpan<S>
where S: HasLength,

Source§

fn len(&self) -> usize

The number of child items in the entry. This is indexed with the size used in truncate.
Source§

fn is_empty(&self) -> bool

Source§

impl<S> Hash for ReverseSpan<S>
where S: Hash,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<S> MergableSpan for ReverseSpan<S>
where S: MergableSpan,

Source§

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>)

Merge the passed item into self. Essentially, self = self + other. Read more
Source§

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,

Source§

fn eq(&self, other: &ReverseSpan<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S> SplitableSpanCtx for ReverseSpan<S>
where S: SplitableSpanCtx<Ctx = ()>,

Source§

type Ctx = ()

Source§

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 more
Source§

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.
Source§

fn split_ctx(self, at: usize, ctx: &Self::Ctx) -> (Self, Self)

Source§

impl<S> Copy for ReverseSpan<S>
where S: Copy,

Source§

impl<S> Eq for ReverseSpan<S>
where S: Eq,

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SplitableSpan for T
where T: SplitableSpanCtx<Ctx = ()>,

Source§

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 more
Source§

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.
Source§

fn split_h(self, at: usize) -> (Self, Self)

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> Trim for T

Source§

fn trim(&mut self, at: usize) -> Option<Self>

Source§

impl<T> TrimCtx for T

Source§

fn trim_ctx(&mut self, at: usize, ctx: &Self::Ctx) -> Option<Self>

Trim self to at most at items. Remainder (if any) is returned.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ContentTraits for T

Source§

impl<T> SplitAndJoinSpan for T

Source§

impl<T> SplitAndJoinSpanCtx for T