Trait PeerMetaStore

Source
pub trait PeerMetaStore:
    'static
    + Send
    + Sync
    + Debug {
    // Required methods
    fn put(
        &self,
        peer: Url,
        key: String,
        value: Bytes,
        expiry: Option<Timestamp>,
    ) -> BoxFuture<'_, K2Result<()>>;
    fn get(
        &self,
        peer: Url,
        key: String,
    ) -> BoxFuture<'_, K2Result<Option<Bytes>>>;
    fn delete(&self, peer: Url, key: String) -> BoxFuture<'_, K2Result<()>>;
}
Expand description

A store for peer metadata.

This is expected to be backed by a key-value store that keys by space, peer URL and key.

Required Methods§

Source

fn put( &self, peer: Url, key: String, value: Bytes, expiry: Option<Timestamp>, ) -> BoxFuture<'_, K2Result<()>>

Store a key-value pair for a given space and peer.

Source

fn get(&self, peer: Url, key: String) -> BoxFuture<'_, K2Result<Option<Bytes>>>

Get a value by key for a given space and peer.

Source

fn delete(&self, peer: Url, key: String) -> BoxFuture<'_, K2Result<()>>

Delete a key-value pair for a given space and peer.

Implementors§