Trait askar_storage::backend::Backend
source · pub trait Backend: Debug + Send + Sync {
type Session: BackendSession + 'static;
// Required methods
fn create_profile(
&self,
name: Option<String>
) -> BoxFuture<'_, Result<String, Error>>;
fn get_active_profile(&self) -> String;
fn get_default_profile(&self) -> BoxFuture<'_, Result<String, Error>>;
fn set_default_profile(
&self,
profile: String
) -> BoxFuture<'_, Result<(), Error>>;
fn list_profiles(&self) -> BoxFuture<'_, Result<Vec<String>, Error>>;
fn remove_profile(&self, name: String) -> BoxFuture<'_, Result<bool, Error>>;
fn scan(
&self,
profile: Option<String>,
kind: Option<EntryKind>,
category: Option<String>,
tag_filter: Option<TagFilter>,
offset: Option<i64>,
limit: Option<i64>
) -> BoxFuture<'_, Result<Scan<'static, Entry>, Error>>;
fn session(
&self,
profile: Option<String>,
transaction: bool
) -> Result<Self::Session, Error>;
fn rekey(
&mut self,
method: StoreKeyMethod,
key: PassKey<'_>
) -> BoxFuture<'_, Result<(), Error>>;
fn close(&self) -> BoxFuture<'_, Result<(), Error>>;
}Expand description
Represents a generic backend implementation
Required Associated Types§
sourcetype Session: BackendSession + 'static
type Session: BackendSession + 'static
The type of session managed by this backend
Required Methods§
sourcefn create_profile(
&self,
name: Option<String>
) -> BoxFuture<'_, Result<String, Error>>
fn create_profile( &self, name: Option<String> ) -> BoxFuture<'_, Result<String, Error>>
Create a new profile
sourcefn get_active_profile(&self) -> String
fn get_active_profile(&self) -> String
Get the name of the active profile
sourcefn get_default_profile(&self) -> BoxFuture<'_, Result<String, Error>>
fn get_default_profile(&self) -> BoxFuture<'_, Result<String, Error>>
Get the name of the default profile
sourcefn set_default_profile(
&self,
profile: String
) -> BoxFuture<'_, Result<(), Error>>
fn set_default_profile( &self, profile: String ) -> BoxFuture<'_, Result<(), Error>>
Set the the default profile
sourcefn list_profiles(&self) -> BoxFuture<'_, Result<Vec<String>, Error>>
fn list_profiles(&self) -> BoxFuture<'_, Result<Vec<String>, Error>>
Get the details of all store profiles
sourcefn remove_profile(&self, name: String) -> BoxFuture<'_, Result<bool, Error>>
fn remove_profile(&self, name: String) -> BoxFuture<'_, Result<bool, Error>>
Remove an existing profile
sourcefn scan(
&self,
profile: Option<String>,
kind: Option<EntryKind>,
category: Option<String>,
tag_filter: Option<TagFilter>,
offset: Option<i64>,
limit: Option<i64>
) -> BoxFuture<'_, Result<Scan<'static, Entry>, Error>>
fn scan( &self, profile: Option<String>, kind: Option<EntryKind>, category: Option<String>, tag_filter: Option<TagFilter>, offset: Option<i64>, limit: Option<i64> ) -> BoxFuture<'_, Result<Scan<'static, Entry>, Error>>
Create a Scan against the store
sourcefn session(
&self,
profile: Option<String>,
transaction: bool
) -> Result<Self::Session, Error>
fn session( &self, profile: Option<String>, transaction: bool ) -> Result<Self::Session, Error>
Create a new session against the store
Implementors§
source§impl Backend for AnyBackend
impl Backend for AnyBackend
type Session = AnyBackendSession
source§impl Backend for PostgresBackend
Available on crate feature postgres only.
impl Backend for PostgresBackend
Available on crate feature
postgres only.