[−][src]Struct drop_move::DropHandle
A wrapper of T::Outer
that will drop by converting to T
then
dropping, rather than dropping the T::Outer
.
The trouble with making drop
be pass by move is that the self
parameter may end up being
dropped, creating infinite recursion. To avoid this, a DropHandle
is passed to
drop_move
so that if it goes out of scope it will not create infinite
recursion. This implements Deref
and DerefMut
for easy access to functions on
T::Outer
.
Implementations
impl<T: DropMoveTypes> DropHandle<T>
[src]
pub fn into_inner(self_: Self) -> T
[src]
Convert to the inner structure T
.
This is an associated function so that will not conflict with any methods of T::Outer
,
which are accessible through Deref
.
pub fn into_outer(self_: Self) -> T::Outer
[src]
Convert to the outer structure T::Outer
. Be careful when using this function, as it is
easy to end up recursively calling drop
on the output by accident, creating an infinite
recursive loop.
This is an associated function so that will not conflict with any methods of T::Outer
,
which are accessible through Deref
.
Trait Implementations
impl<T: Debug + DropMoveTypes> Debug for DropHandle<T> where
T::Outer: Debug,
[src]
T::Outer: Debug,
impl<T: DropMoveTypes> Deref for DropHandle<T>
[src]
impl<T: DropMoveTypes> DerefMut for DropHandle<T>
[src]
impl<T: DropMoveTypes> Drop for DropHandle<T>
[src]
impl<T: DropMoveTypes> From<T> for DropHandle<T>
[src]
Auto Trait Implementations
impl<T> Send for DropHandle<T> where
<T as DropMoveTypes>::Outer: Send,
[src]
<T as DropMoveTypes>::Outer: Send,
impl<T> Sync for DropHandle<T> where
<T as DropMoveTypes>::Outer: Sync,
[src]
<T as DropMoveTypes>::Outer: Sync,
impl<T> Unpin for DropHandle<T> where
<T as DropMoveTypes>::Outer: Unpin,
[src]
<T as DropMoveTypes>::Outer: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,