Skip to main content

Store

Trait Store 

Source
pub trait Store: Send + Sync {
    // Required methods
    fn get(
        &self,
        service: &str,
        key: &str,
    ) -> Result<Option<Zeroizing<String>>, StoreError>;
    fn put(
        &self,
        service: &str,
        key: &str,
        value: &str,
    ) -> Result<(), StoreError>;
}
Expand description

A host’s secret store: what the provider needs of Credential Manager or the Secret Service.

Required Methods§

Source

fn get( &self, service: &str, key: &str, ) -> Result<Option<Zeroizing<String>>, StoreError>

The value of key under service; None when there is none.

§Errors

The store could not be reached or refused.

Source

fn put(&self, service: &str, key: &str, value: &str) -> Result<(), StoreError>

Keeps value as key under service, replacing an entry already there.

§Errors

The store could not be reached or refused.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§