Struct fixed_typed_arena::ManuallyDropArena [−][src]
pub struct ManuallyDropArena<T, const CHUNK_SIZE: usize>(_);
Expand description
Implementations
Creates a new ManuallyDropArena
.
Allocates a new item in the arena and initializes it with value
.
Returns a reference to the allocated item. The reference can have any
lifetime, including 'static
, as long as T
outlives that lifetime.
Drops the contents of the arena. The arena will leak memory when dropped unless this method is called.
Safety
You must ensure that no references to items (or parts of items) in the arena exist when calling this method, except possibly for references within the items themselves.
However, if there are references to other items (or parts of items) within the items themselves, at least one of the following must be true:
T
does not have a customDrop
impl.T
’sDrop
impl does not directly or indirectly access any data via the references to other items or parts of items. (This is essentially the requirement imposed by#[may_dangle]
.)