[][src]Trait owned::DerefTake

pub unsafe trait DerefTake: Deref {
    fn deref_take(self) -> <Self::Target as IntoOwned>::Owned
    where
        Self::Target: IntoOwned
;
fn deref_take_unsized<F, R>(self, f: F) -> R
    where
        F: FnOnce(&mut ManuallyDrop<Self::Target>) -> R
; }

Deref, but for taking ownership.

Required methods

fn deref_take(self) -> <Self::Target as IntoOwned>::Owned where
    Self::Target: IntoOwned

Takes ownership, consuming the container.

fn deref_take_unsized<F, R>(self, f: F) -> R where
    F: FnOnce(&mut ManuallyDrop<Self::Target>) -> R, 

Takes ownership of an unsized type with the aid of a closure.

The closure is called with an mutable reference to ManuallyDrop<T>. After the closure returns the memory occupied by the value will be deallocated, but drop() will not be called on the value itself.

Loading content...

Implementations on Foreign Types

impl<T: ?Sized> DerefTake for Box<T>[src]

impl<T> DerefTake for Vec<T>[src]

impl<T> DerefTake for ManuallyDrop<T>[src]

impl<T: Clone> DerefTake for Rc<T>[src]

Loading content...

Implementors

Loading content...