pub struct Permanent<T: 'static> { /* private fields */ }Expand description
Handle that mimics a 'static reference.
Thread Safety: Can be used anywhere and does not produce any form of overhead.
Implementations§
Source§impl<T: 'static> Permanent<T>
impl<T: 'static> Permanent<T>
Sourcepub unsafe fn drop_permanent(self)
pub unsafe fn drop_permanent(self)
Drop the stored value.
§Safety
The caller MUST ensure that:
- No other copies of this
Permanent<T>(or any references derived from it) exist anywhere in the program. - This function is called exactly once for the allocated memory.
Trait Implementations§
impl<T: 'static> Copy for Permanent<T>
impl<T: Sync + 'static> Send for Permanent<T>
impl<T: Sync + 'static> Sync for Permanent<T>
Auto Trait Implementations§
impl<T> Freeze for Permanent<T>
impl<T> RefUnwindSafe for Permanent<T>where
T: RefUnwindSafe,
impl<T> Unpin for Permanent<T>
impl<T> UnsafeUnpin for Permanent<T>
impl<T> UnwindSafe for Permanent<T>where
T: RefUnwindSafe,
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