[][src]Struct detach::Detach

pub struct Detach<T>(_);

Allows sub-struct to be easily detached and re-attached

Methods

impl<T> Detach<T>[src]

pub fn new(inner: T) -> Self[src]

create a new Detach instance

pub fn to_inner(self) -> T[src]

extract the owned inner instance

pub fn is_attached(&self) -> bool[src]

returns true if this instance contains Some value.

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

take the owned inner instance (without droping the container)

pub fn put(&mut self, t: T)[src]

replace the owned inner instance

Trait Implementations

impl<T> AsMut<T> for Detach<T>[src]

impl<T> AsRef<T> for Detach<T>[src]

impl<T> Borrow<T> for Detach<T>[src]

impl<T> BorrowMut<T> for Detach<T>[src]

impl<T: Clone> Clone for Detach<T>[src]

impl<T: Copy> Copy for Detach<T>[src]

impl<T: Debug> Debug for Detach<T>[src]

impl<T: Default> Default for Detach<T>[src]

impl<T> Deref for Detach<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for Detach<T>[src]

impl<T: Eq> Eq for Detach<T>[src]

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

impl<T: Hash> Hash for Detach<T>[src]

impl<T: Ord> Ord for Detach<T>[src]

impl<T: PartialEq> PartialEq<Detach<T>> for Detach<T>[src]

impl<T: PartialOrd> PartialOrd<Detach<T>> for Detach<T>[src]

impl<T> StructuralEq for Detach<T>[src]

impl<T> StructuralPartialEq for Detach<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Detach<T> where
    T: RefUnwindSafe

impl<T> Send for Detach<T> where
    T: Send

impl<T> Sync for Detach<T> where
    T: Sync

impl<T> Unpin for Detach<T> where
    T: Unpin

impl<T> UnwindSafe for Detach<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.