pub struct RleRun<T>{
pub val: T,
pub len: usize,
}
Expand description
A splitablespan which contains a single element repeated N times. This is used in some examples.
Fields§
§val: T
§len: usize
Implementations§
Trait Implementations§
Source§impl<T> MergableSpan for RleRun<T>
impl<T> MergableSpan for RleRun<T>
Source§impl<T> SplitableSpanHelpers for RleRun<T>
impl<T> SplitableSpanHelpers for RleRun<T>
Source§fn truncate_h(&mut self, at: usize) -> RleRun<T>
fn truncate_h(&mut self, at: usize) -> RleRun<T>
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_h(&mut self, at: usize) -> Self
fn truncate_keeping_right_h(&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.
fn split(self, at: usize) -> (Self, Self)
impl<T> Copy for RleRun<T>
impl<T> Eq for RleRun<T>
impl<T> StructuralPartialEq for RleRun<T>
Auto Trait Implementations§
impl<T> Freeze for RleRun<T>where
T: Freeze,
impl<T> RefUnwindSafe for RleRun<T>where
T: RefUnwindSafe,
impl<T> Send for RleRun<T>where
T: Send,
impl<T> Sync for RleRun<T>where
T: Sync,
impl<T> Unpin for RleRun<T>where
T: Unpin,
impl<T> UnwindSafe for RleRun<T>where
T: 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.
fn split_h(self, at: usize) -> (Self, Self)
Source§impl<T> SplitableSpanCtx for Twhere
T: SplitableSpanHelpers,
impl<T> SplitableSpanCtx for Twhere
T: SplitableSpanHelpers,
type Ctx = ()
Source§fn truncate_ctx(&mut self, at: usize, _ctx: &<T as SplitableSpanCtx>::Ctx) -> T
fn truncate_ctx(&mut self, at: usize, _ctx: &<T as SplitableSpanCtx>::Ctx) -> T
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: &Self::Ctx) -> Self
fn truncate_keeping_right_ctx(&mut self, at: usize, ctx: &Self::Ctx) -> 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.