#[repr(transparent)]pub struct Unleak<'a, T: ?Sized> {
_unforget: PhantomStaticUnforget,
_anchor: PhantomData<fn(&'a ())>,
inner: T,
}Expand description
A transparent wrapper to make your types !Forget
Fields§
§_unforget: PhantomStaticUnforget§_anchor: PhantomData<fn(&'a ())>Inner value must be able to outlive this lifetime to be able to
be forgotten. Of course it is contravariant, since expanding it
may only disable the Forget implementation.
inner: TImplementations§
Source§impl<'a, T> Unforget<'a, T>
impl<'a, T> Unforget<'a, T>
pub fn with_lifetime(inner: T) -> Self
Sourcepub fn into_inner(slot: Self) -> T
pub fn into_inner(slot: Self) -> T
Get inner value.
Trait Implementations§
Source§impl<'a, T: Ord + ?Sized> Ord for Unforget<'a, T>
impl<'a, T: Ord + ?Sized> Ord for Unforget<'a, T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, T: PartialOrd + ?Sized> PartialOrd for Unforget<'a, T>
impl<'a, T: PartialOrd + ?Sized> PartialOrd for Unforget<'a, T>
impl<'a, T: Copy + ?Sized> Copy for Unforget<'a, T>
impl<'a, T: Eq + ?Sized> Eq for Unforget<'a, T>
impl<'a, T: ?Sized + 'a> Forget for Unforget<'a, T>
impl<'a, T: ?Sized> StructuralPartialEq for Unforget<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Unforget<'a, T>
impl<'a, T> RefUnwindSafe for Unforget<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> Send for Unforget<'a, T>
impl<'a, T> Sync for Unforget<'a, T>
impl<'a, T> Unpin for Unforget<'a, T>
impl<'a, T> UnsafeUnpin for Unforget<'a, T>where
T: UnsafeUnpin + ?Sized,
impl<'a, T> UnwindSafe for Unforget<'a, T>where
T: UnwindSafe + ?Sized,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more