pub struct InstanceHandleAllocator { /* private fields */ }Expand description
Atomic counter for handing out unique InstanceHandle values.
One instance per runtime/process — typically on the DcpsRuntime
as the shared allocation source for entities and sample instances.
Implementations§
Source§impl InstanceHandleAllocator
impl InstanceHandleAllocator
Sourcepub const fn new() -> Self
pub const fn new() -> Self
New allocator. The first allocation returns 1 (HANDLE_NIL=0 is
reserved).
Sourcepub fn allocate(&self) -> InstanceHandle
pub fn allocate(&self) -> InstanceHandle
Returns the next free handle (monotonically increasing). Thread-safe.
Trait Implementations§
Source§impl Debug for InstanceHandleAllocator
impl Debug for InstanceHandleAllocator
Auto Trait Implementations§
impl !Freeze for InstanceHandleAllocator
impl RefUnwindSafe for InstanceHandleAllocator
impl Send for InstanceHandleAllocator
impl Sync for InstanceHandleAllocator
impl Unpin for InstanceHandleAllocator
impl UnsafeUnpin for InstanceHandleAllocator
impl UnwindSafe for InstanceHandleAllocator
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