pub struct IdAllocator { /* private fields */ }Expand description
Ids reserved so far, per counter key: the next id each counter hands out when its durable watermark is not higher.
Implementations§
Source§impl IdAllocator
impl IdAllocator
Sourcepub fn reserve(&self, key: &[u8], watermark: u64) -> Result<u64, StorageError>
pub fn reserve(&self, key: &[u8], watermark: u64) -> Result<u64, StorageError>
Reserve the next id of the counter at key, given the counter’s
watermark as the caller’s view sees it.
§Errors
Returns StorageError::Builder if the reservation table’s lock is
poisoned, or StorageError::ResourceExhausted if the counter would
pass u64::MAX.
Trait Implementations§
Source§impl Debug for IdAllocator
impl Debug for IdAllocator
Auto Trait Implementations§
impl !Freeze for IdAllocator
impl Forget for IdAllocator
impl RefUnwindSafe for IdAllocator
impl Send for IdAllocator
impl Sync for IdAllocator
impl Unpin for IdAllocator
impl UnsafeUnpin for IdAllocator
impl UnwindSafe for IdAllocator
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