Struct wgpu_core::hub::IdentityManager
source · [−]pub struct IdentityManager { /* private fields */ }
Expand description
A simple structure to allocate Id
identifiers.
Calling alloc
returns a fresh, never-before-seen id. Calling free
marks an id as dead; it will never be returned again by alloc
.
Use IdentityManager::default
to construct new instances.
IdentityManager
returns Id
s whose index values are suitable for use as
indices into a Storage<T>
that holds those ids’ referents:
-
Every live id has a distinct index value. Each live id’s index selects a distinct element in the vector.
-
IdentityManager
prefers low index numbers. If you size your vector to accommodate the indices produced here, the vector’s length will reflect the highwater mark of actual occupancy. -
IdentityManager
reuses the index values of freed ids before returning ids with new index values. Freed vector entries get reused.
Implementations
Trait Implementations
sourceimpl Debug for IdentityManager
impl Debug for IdentityManager
sourceimpl Default for IdentityManager
impl Default for IdentityManager
sourcefn default() -> IdentityManager
fn default() -> IdentityManager
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for IdentityManager
impl Send for IdentityManager
impl Sync for IdentityManager
impl Unpin for IdentityManager
impl UnwindSafe for IdentityManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more