ResourceIdAllocator

Trait ResourceIdAllocator 

Source
pub trait ResourceIdAllocator: Send + Sync {
    // Required methods
    fn next<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn peek<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn jump_to<'life0, 'async_trait>(
        &'life0 self,
        next: u64,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn min_max<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Range<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn next<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the next value and increments the sequence.

Source

fn peek<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the current value stored in the remote storage without incrementing the sequence.

Source

fn jump_to<'life0, 'async_trait>( &'life0 self, next: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Jumps to the given value.

Source

fn min_max<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Range<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the range of available sequences.

Implementors§