Skip to main content

BindingSequenceStore

Trait BindingSequenceStore 

Source
pub trait BindingSequenceStore: Send + Sync {
    // Required method
    fn next_binding_seq<'life0, 'life1, 'async_trait>(
        &'life0 self,
        device: &'life1 DeviceId,
        now: i64,
    ) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Origin-side per-device binding sequence. Keyed by device alone: a device id re-bound to another user still supersedes its previous binding, which is what an edge must see when a node changes hands.

Required Methods§

Source

fn next_binding_seq<'life0, 'life1, 'async_trait>( &'life0 self, device: &'life1 DeviceId, now: i64, ) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Advance device’s sequence by next_binding_seq and return it, as one atomic step: two concurrent mints for one device never share a sequence.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: BindingSequenceStore + ?Sized> BindingSequenceStore for Arc<T>

Source§

fn next_binding_seq<'life0, 'life1, 'async_trait>( &'life0 self, device: &'life1 DeviceId, now: i64, ) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§