struct OptGuard<'a, T>(Pin<&'a mut Option<T>>, bool);
Expand description
A drop guard to allow a mutable borrow of an Option while being able to
set whether the Option
should be cleared on drop.
Tuple Fields§
§0: Pin<&'a mut Option<T>>
§1: bool
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for OptGuard<'a, T>
impl<'a, T> RefUnwindSafe for OptGuard<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for OptGuard<'a, T>where
T: Send,
impl<'a, T> Sync for OptGuard<'a, T>where
T: Sync,
impl<'a, T> Unpin for OptGuard<'a, T>
impl<'a, T> !UnwindSafe for OptGuard<'a, T>
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