pub struct Handle<T> { /* private fields */ }Expand description
An opaque, copyable reference to a value stored in a Region.
A handle wraps a slotmap::DefaultKey (an index plus a generation) and is
Copy and unconditionally Send + Sync regardless of T — it owns no T,
it only names one. The PhantomData<fn() -> T> keeps the handle typed (so
a Handle<A> cannot be passed to a Region<B>) while staying covariant in
T and free of any drop/auto-trait obligations.
Trait Implementations§
impl<T> Copy for Handle<T>
impl<T> Eq for Handle<T>
Auto Trait Implementations§
impl<T> Freeze for Handle<T>
impl<T> RefUnwindSafe for Handle<T>
impl<T> Send for Handle<T>
impl<T> Sync for Handle<T>
impl<T> Unpin for Handle<T>
impl<T> UnsafeUnpin for Handle<T>
impl<T> UnwindSafe for Handle<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