[][src]Trait parsec_service::key_id_managers::ManageKeyIDs

pub trait ManageKeyIDs {
    fn get(&self, key_triple: &KeyTriple) -> Result<Option<&[u8]>, String>;
fn get_all(
        &self,
        provider_id: ProviderID
    ) -> Result<Vec<&KeyTriple>, String>;
fn insert(
        &mut self,
        key_triple: KeyTriple,
        key_id: Vec<u8>
    ) -> Result<Option<Vec<u8>>, String>;
fn remove(
        &mut self,
        key_triple: &KeyTriple
    ) -> Result<Option<Vec<u8>>, String>;
fn exists(&self, key_triple: &KeyTriple) -> Result<bool, String>; }

Required methods

fn get(&self, key_triple: &KeyTriple) -> Result<Option<&[u8]>, String>

Returns a reference to the key ID corresponding to this key triple or None if it does not exist.

Errors

Returns an error as a String if there was a problem accessing the Key ID Manager.

fn get_all(&self, provider_id: ProviderID) -> Result<Vec<&KeyTriple>, String>

Returns a Vec of reference to the key triples corresponding to this provider.

Errors

Returns an error as a String if there was a problem accessing the Key ID Manager.

fn insert(
    &mut self,
    key_triple: KeyTriple,
    key_id: Vec<u8>
) -> Result<Option<Vec<u8>>, String>

Inserts a new mapping between the key triple and the key ID. If the triple already exists, overwrite the existing mapping and returns the old Key ID. Otherwise returns None.

Errors

Returns an error as a String if there was a problem accessing the Key ID Manager.

fn remove(&mut self, key_triple: &KeyTriple) -> Result<Option<Vec<u8>>, String>

Removes a key triple mapping and returns it. Does nothing and returns None if the mapping does not exist.

Errors

Returns an error as a String if there was a problem accessing the Key ID Manager.

fn exists(&self, key_triple: &KeyTriple) -> Result<bool, String>

Check if a key triple mapping exists.

Errors

Returns an error as a String if there was a problem accessing the Key ID Manager.

Loading content...

Implementors

impl ManageKeyIDs for OnDiskKeyIDManager[src]

Loading content...