Trait trust_graph::Storage[][src]

pub trait Storage {
    type Error: StorageError + 'static;
    fn get(&self, pk: &PK) -> Result<Option<TrustNode>, Self::Error>;
fn insert(&mut self, pk: PK, node: TrustNode) -> Result<(), Self::Error>;
fn get_root_weight(&self, pk: &PK) -> Result<Option<Weight>, Self::Error>;
fn add_root_weight(
        &mut self,
        pk: PK,
        weight: Weight
    ) -> Result<(), Self::Error>;
fn root_keys(&self) -> Result<Vec<PK>, Self::Error>;
fn revoke(&mut self, pk: &PK, revoke: Revoke) -> Result<(), Self::Error>;
fn update_auth(
        &mut self,
        pk: &PK,
        auth: Auth,
        issued_for: &PublicKey,
        cur_time: Duration
    ) -> Result<(), Self::Error>; }

Associated Types

type Error: StorageError + 'static[src]

Loading content...

Required methods

fn get(&self, pk: &PK) -> Result<Option<TrustNode>, Self::Error>[src]

fn insert(&mut self, pk: PK, node: TrustNode) -> Result<(), Self::Error>[src]

fn get_root_weight(&self, pk: &PK) -> Result<Option<Weight>, Self::Error>[src]

fn add_root_weight(&mut self, pk: PK, weight: Weight) -> Result<(), Self::Error>[src]

fn root_keys(&self) -> Result<Vec<PK>, Self::Error>[src]

fn revoke(&mut self, pk: &PK, revoke: Revoke) -> Result<(), Self::Error>[src]

fn update_auth(
    &mut self,
    pk: &PK,
    auth: Auth,
    issued_for: &PublicKey,
    cur_time: Duration
) -> Result<(), Self::Error>
[src]

Loading content...

Implementors

impl Storage for InMemoryStorage[src]

type Error = InMemoryStorageError

Loading content...