WithCtx

Struct WithCtx 

Source
pub struct WithCtx<'a, T: SplitableSpanCtx + Clone>(pub T, pub &'a T::Ctx);

Tuple Fields§

§0: T§1: &'a T::Ctx

Implementations§

Source§

impl<'a, T: SplitableSpanCtx + Clone> WithCtx<'a, T>

Source

pub fn new(t: T, ctx: &'a T::Ctx) -> Self

Source

pub fn to_inner(self) -> T

Trait Implementations§

Source§

impl<'a, T: SplitableSpanCtx + Clone> Clone for WithCtx<'a, T>

Source§

fn clone(&self) -> Self

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<'a, T: Debug + SplitableSpanCtx + Clone> Debug for WithCtx<'a, T>
where T::Ctx: Debug,

Source§

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

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

impl<'a, T: SplitableSpanCtx + Clone> Deref for WithCtx<'a, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a, T: SplitableSpanCtx + Clone> DerefMut for WithCtx<'a, T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'a, T: SplitableSpanCtx + HasLength> HasLength for WithCtx<'a, T>

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<'a, T: SplitableSpanCtx> SplitableSpanCtx for WithCtx<'a, T>

Source§

type Ctx = ()

Source§

fn truncate_ctx(&mut self, at: usize, _ctx: &Self::Ctx) -> 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_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.
Source§

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

Auto Trait Implementations§

§

impl<'a, T> Freeze for WithCtx<'a, T>
where T: Freeze,

§

impl<'a, T> RefUnwindSafe for WithCtx<'a, T>

§

impl<'a, T> Send for WithCtx<'a, T>
where T: Send, <T as SplitableSpanCtx>::Ctx: Sync,

§

impl<'a, T> Sync for WithCtx<'a, T>
where T: Sync, <T as SplitableSpanCtx>::Ctx: Sync,

§

impl<'a, T> Unpin for WithCtx<'a, T>
where T: Unpin,

§

impl<'a, T> UnwindSafe for WithCtx<'a, T>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.