pub struct DropGuard<T: DropIn, A: Allocator> { /* private fields */ }Expand description
A temporary guard object that will DropIn the value
using the associated alloc on Drop.
Implementations§
Source§impl<T: DropIn, A: Allocator> DropGuard<T, A>
impl<T: DropIn, A: Allocator> DropGuard<T, A>
Sourcepub fn split(self) -> (ManuallyDrop<T>, A)
pub fn split(self) -> (ManuallyDrop<T>, A)
Split the DropGuard into its constituent parts. The caller is taking
responsibility for drop_in T in A.
Sourcepub fn map<U: DropIn, F>(self, f: F) -> DropGuard<U, A>where
F: FnOnce(T) -> U,
pub fn map<U: DropIn, F>(self, f: F) -> DropGuard<U, A>where
F: FnOnce(T) -> U,
Apply a function f to the inner value. Note that the
value will not be dropped by this function.
Sourcepub fn into_inner(self) -> ManuallyDrop<T>
pub fn into_inner(self) -> ManuallyDrop<T>
Unwrap the inner value. This is intended to transfer ownership into the permanent data structure.
Trait Implementations§
Auto Trait Implementations§
impl<T, A> Freeze for DropGuard<T, A>
impl<T, A> RefUnwindSafe for DropGuard<T, A>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> Send for DropGuard<T, A>
impl<T, A> Sync for DropGuard<T, A>
impl<T, A> Unpin for DropGuard<T, A>
impl<T, A> UnwindSafe for DropGuard<T, A>where
A: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more