pub struct TsIdAllocator { /* private fields */ }
Implementations§
Source§impl TsIdAllocator
impl TsIdAllocator
pub const INVALID_ID: i32 = -1i32
pub fn new(start: i32, capacity: i32) -> Self
pub fn allocate_id(&mut self) -> i32
Sourcepub fn release_id(&mut self, id: i32) -> RESULT
pub fn release_id(&mut self, id: i32) -> RESULT
释放一个申请的ID
pub fn reserve_id(&mut self, id: i32) -> RESULT
pub fn capacity(&self) -> i32
pub fn used_count(&self) -> i32
Auto Trait Implementations§
impl !Freeze for TsIdAllocator
impl RefUnwindSafe for TsIdAllocator
impl !Send for TsIdAllocator
impl !Sync for TsIdAllocator
impl Unpin for TsIdAllocator
impl UnwindSafe for TsIdAllocator
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