pub struct AtomicHandleAllocator(/* private fields */);Expand description
An implementation of HandleAllocator which uses an incrementing AtomicU64 internally to allocate LoadHandle IDs.
Implementations§
Trait Implementations§
Source§impl Default for AtomicHandleAllocator
impl Default for AtomicHandleAllocator
Source§impl HandleAllocator for &'static AtomicHandleAllocator
impl HandleAllocator for &'static AtomicHandleAllocator
Source§fn alloc(&self) -> LoadHandle
fn alloc(&self) -> LoadHandle
Allocates a
LoadHandle for use by a crate::loader::Loader.
The same LoadHandle must not be returned by this function until it has been passed to free.
NOTE: The most significant bit of the u64 in the LoadHandle returned MUST be unset,
as it is reserved for indicating whether the handle is indirect or not.Source§fn free(&self, _handle: LoadHandle)
fn free(&self, _handle: LoadHandle)
Frees a
LoadHandle, allowing the handle to be returned by a future alloc call.Source§impl HandleAllocator for AtomicHandleAllocator
impl HandleAllocator for AtomicHandleAllocator
Source§fn alloc(&self) -> LoadHandle
fn alloc(&self) -> LoadHandle
Allocates a
LoadHandle for use by a crate::loader::Loader.
The same LoadHandle must not be returned by this function until it has been passed to free.
NOTE: The most significant bit of the u64 in the LoadHandle returned MUST be unset,
as it is reserved for indicating whether the handle is indirect or not.Source§fn free(&self, _handle: LoadHandle)
fn free(&self, _handle: LoadHandle)
Frees a
LoadHandle, allowing the handle to be returned by a future alloc call.Auto Trait Implementations§
impl !Freeze for AtomicHandleAllocator
impl RefUnwindSafe for AtomicHandleAllocator
impl Send for AtomicHandleAllocator
impl Sync for AtomicHandleAllocator
impl Unpin for AtomicHandleAllocator
impl UnwindSafe for AtomicHandleAllocator
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