Struct left_right::Taken[][src]

pub struct Taken<T: Absorb<O>, O> { /* fields omitted */ }

A smart pointer to an owned backing data structure. This makes sure that the data is dropped correctly (using Absorb::drop_second).

Additionally it allows for unsafely getting the inner data out using into_box().

Implementations

impl<T: Absorb<O>, O> Taken<T, O>[src]

pub unsafe fn into_box(self) -> Box<T>[src]

This is unsafe because you must call Absorb::drop_second in case just dropping T is not safe and sufficient.

If you used the default implementation of Absorb::drop_second (which just calls drop) you don’t need to call Absorb::drop_second.

Trait Implementations

impl<T: Absorb<O> + Debug, O> Debug for Taken<T, O>[src]

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

Formats the value using the given formatter. Read more

impl<T: Absorb<O>, O> Deref for Taken<T, O>[src]

type Target = T

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl<T: Absorb<O>, O> DerefMut for Taken<T, O>[src]

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

Mutably dereferences the value.

impl<T: Absorb<O>, O> Drop for Taken<T, O>[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<T, O> RefUnwindSafe for Taken<T, O> where
    O: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, O> Send for Taken<T, O> where
    O: Send,
    T: Send

impl<T, O> Sync for Taken<T, O> where
    O: Sync,
    T: Sync

impl<T, O> Unpin for Taken<T, O> where
    O: Unpin

impl<T, O> UnwindSafe for Taken<T, O> where
    O: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.