[−][src]Struct high_mem_utils::DontDrop
A wrapper for an implementation of drop that mem::take
the value and [mem::forget
]s it.
This might be useful if you want assuring that a particular destructor not run if it can lead to a double-free or another memory issue.
This type is particularly not recomended for reference types because as such they can never be null
and the value is still dropped. Neither on types with a costly initialization because it replaces the
forgotten value with the Default
one,these values should not implement it anyways.
This type has the same implications that forget except for the fact that this ensures that the value
is never dropped even on panic,unless you abort.In general DontDropOpt
is preferred.
It derefs to T.
Methods
impl<T: Default> DontDrop<T>
[src]
pub fn into_inner(&mut self) -> T
[src]
Returns the field,allowing it to be dropped again.
Trait Implementations
impl<T: Default> Deref for DontDrop<T>
[src]
impl<T: Default> DerefMut for DontDrop<T>
[src]
impl<T: Default> Drop for DontDrop<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for DontDrop<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for DontDrop<T> where
T: Send,
T: Send,
impl<T> Sync for DontDrop<T> where
T: Sync,
T: Sync,
impl<T> Unpin for DontDrop<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for DontDrop<T> where
T: UnwindSafe,
T: UnwindSafe,
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,
fn borrow_mut(&mut self) -> &mut 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.
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>,