Trait burble::PeerStore

source ·
pub trait PeerStore: Debug + Send + Sync {
    type Value;

    // Required methods
    fn save(&self, peer: Addr, v: &Self::Value) -> bool;
    fn load(&self, peer: Addr) -> Option<Self::Value>;
    fn remove(&self, peer: Addr);
    fn clear(&self);
}
Expand description

Interface to persistent peer data storage.

Required Associated Types§

source

type Value

Type of stored data.

Required Methods§

source

fn save(&self, peer: Addr, v: &Self::Value) -> bool

Saves peer data and returns true if the operation was successful.

source

fn load(&self, peer: Addr) -> Option<Self::Value>

Loads peer data.

source

fn remove(&self, peer: Addr)

Removes peer data.

source

fn clear(&self)

Removes all peer data.

Implementors§