Skip to main content

TileStore

Trait TileStore 

Source
pub trait TileStore: Send + Sync {
    // Required methods
    fn read_tile<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, TransparencyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn write_tile<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        data: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), TransparencyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn read_checkpoint<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, TransparencyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn write_checkpoint<'life0, 'life1, 'async_trait>(
        &'life0 self,
        data: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), TransparencyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Async tile storage backend.

Implementations provide reading and writing of tile data and checkpoint blobs. The filesystem implementation is in crate::FsTileStore (available with the native feature).

Usage:

async fn read_tile(store: &dyn TileStore) {
    let data = store.read_tile("tile/0/000").await?;
}

Required Methods§

Source

fn read_tile<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, TransparencyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read a tile by its C2SP path (e.g., “tile/0/000”).

Source

fn write_tile<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, path: &'life1 str, data: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), TransparencyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Write a tile at the given C2SP path.

Source

fn read_checkpoint<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, TransparencyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read the latest signed checkpoint.

Source

fn write_checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), TransparencyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Write a signed checkpoint.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§