pub struct HandleManager { /* private fields */ }
Implementations§
Source§impl HandleManager
impl HandleManager
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new handle manager with some default settings. You very likely want to change these to suit your use case.
Sourcepub fn with_alloc_policy(self, policy: AllocPolicy) -> Self
pub fn with_alloc_policy(self, policy: AllocPolicy) -> Self
Changes the allocation policy of handles. Panics if handles have already been issued.
Sourcepub fn with_release_policy(self, policy: ReleasePolicy) -> Self
pub fn with_release_policy(self, policy: ReleasePolicy) -> Self
Changes the release policy of this handle manager. Panics if handles have already been issued.
Sourcepub fn next(&mut self) -> Option<usize>
pub fn next(&mut self) -> Option<usize>
Retrieve a handle from the manager. Either generates a new ID if one cannot be recycled, or recycles one which was previously valid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HandleManager
impl RefUnwindSafe for HandleManager
impl Send for HandleManager
impl Sync for HandleManager
impl Unpin for HandleManager
impl UnwindSafe for HandleManager
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