Struct left_right::Taken
source · [−]pub struct Taken<T: Absorb<O>, O> { /* private fields */ }
Expand description
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
sourceimpl<T: Absorb<O>, O> Taken<T, O>
impl<T: Absorb<O>, O> Taken<T, O>
sourcepub unsafe fn into_box(self) -> Box<T>
pub unsafe fn into_box(self) -> Box<T>
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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more