pub struct Single<T>(pub T);
Expand description
A SplitableSpan wrapper for any single item.
Tuple Fields§
§0: T
Trait Implementations§
Source§impl<T> MergableSpan for Single<T>where
T: Clone,
impl<T> MergableSpan for Single<T>where
T: Clone,
Source§impl<T> SplitableSpanCtx for Single<T>where
T: Clone,
impl<T> SplitableSpanCtx for Single<T>where
T: Clone,
type Ctx = ()
Source§fn truncate_ctx(
&mut self,
_at: usize,
_ctx: &<Single<T> as SplitableSpanCtx>::Ctx,
) -> Single<T>
fn truncate_ctx( &mut self, _at: usize, _ctx: &<Single<T> as SplitableSpanCtx>::Ctx, ) -> Single<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.
fn split_ctx(self, at: usize, ctx: &Self::Ctx) -> (Self, Self)
impl<T> Copy for Single<T>where
T: Copy,
impl<T> Eq for Single<T>where
T: Eq,
impl<T> StructuralPartialEq for Single<T>
Auto Trait Implementations§
impl<T> Freeze for Single<T>where
T: Freeze,
impl<T> RefUnwindSafe for Single<T>where
T: RefUnwindSafe,
impl<T> Send for Single<T>where
T: Send,
impl<T> Sync for Single<T>where
T: Sync,
impl<T> Unpin for Single<T>where
T: Unpin,
impl<T> UnwindSafe for Single<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.