#[repr(transparent)]pub struct Allocated<T: ?Sized>(_);
Expand description
A marker type that can be used within Id
to indicate that the object
has been allocated but not initialized.
The reason we use Option<Id<Allocated<T>, O>>
instead of just *mut T
is:
- To allow releasing allocated objects, e.g. in the face of panics.
- To safely know the object is valid (albeit uninitialized).
- To allow specifying ownership.
Trait Implementations§
Auto Trait Implementations§
impl<T: ?Sized> RefUnwindSafe for Allocated<T>where T: RefUnwindSafe,
impl<T: ?Sized> Send for Allocated<T>where T: Send,
impl<T: ?Sized> Sync for Allocated<T>where T: Sync,
impl<T: ?Sized> Unpin for Allocated<T>where T: Unpin,
impl<T: ?Sized> UnwindSafe for Allocated<T>where 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