Skip to main content

KeyStore

Trait KeyStore 

Source
pub trait KeyStore {
    // Required methods
    fn get(&self, collection: &str, epoch: u32) -> Option<Key>;
    fn put(&self, collection: &str, epoch: u32, key: &Key) -> bool;
    fn epochs(&self, collection: &str) -> Vec<u32>;
    fn forget(&self, collection: &str, epoch: u32);
}
Expand description

Where a machine keeps the keys of the collections it is a member of.

Required Methods§

Source

fn get(&self, collection: &str, epoch: u32) -> Option<Key>

Source

fn put(&self, collection: &str, epoch: u32, key: &Key) -> bool

Keeps the key for an epoch. An epoch that already has a key keeps it: false if it could not be kept.

Source

fn epochs(&self, collection: &str) -> Vec<u32>

The epochs a key is held for, lowest first.

Source

fn forget(&self, collection: &str, epoch: u32)

Forgets the key of an epoch.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§