CounterStore

Trait CounterStore 

Source
pub trait CounterStore {
    type Error;

    // Required methods
    async fn load(&self, context: &[u8]) -> Result<u32, Self::Error>;
    async fn store(&self, context: &[u8], value: u32) -> Result<(), Self::Error>;
    async fn flush(&self) -> Result<(), Self::Error>;
}
Expand description

Persistent frame-counter storage.

Required Associated Types§

Required Methods§

Source

async fn load(&self, context: &[u8]) -> Result<u32, Self::Error>

Load the stored counter for context, or 0 if missing.

Source

async fn store(&self, context: &[u8], value: u32) -> Result<(), Self::Error>

Persist a counter value for context.

Source

async fn flush(&self) -> Result<(), Self::Error>

Flush any buffered state to durable storage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§