Struct aries_askar::Store
source · pub struct Store(/* private fields */);
Expand description
An instance of an opened store
Implementations§
source§impl Store
impl Store
sourcepub async fn provision(
db_url: &str,
key_method: StoreKeyMethod,
pass_key: PassKey<'_>,
profile: Option<String>,
recreate: bool
) -> Result<Self, Error>
pub async fn provision( db_url: &str, key_method: StoreKeyMethod, pass_key: PassKey<'_>, profile: Option<String>, recreate: bool ) -> Result<Self, Error>
Provision a new store instance using a database URL
sourcepub async fn open(
db_url: &str,
key_method: Option<StoreKeyMethod>,
pass_key: PassKey<'_>,
profile: Option<String>
) -> Result<Self, Error>
pub async fn open( db_url: &str, key_method: Option<StoreKeyMethod>, pass_key: PassKey<'_>, profile: Option<String> ) -> Result<Self, Error>
Open a store instance from a database URL
sourcepub async fn remove(db_url: &str) -> Result<bool, Error>
pub async fn remove(db_url: &str) -> Result<bool, Error>
Remove a store instance using a database URL
sourcepub fn new_raw_key(seed: Option<&[u8]>) -> Result<PassKey<'static>, Error>
pub fn new_raw_key(seed: Option<&[u8]>) -> Result<PassKey<'static>, Error>
Generate a new raw store key
sourcepub fn get_active_profile(&self) -> String
pub fn get_active_profile(&self) -> String
Get the default profile name used when starting a scan or a session
sourcepub async fn get_default_profile(&self) -> Result<String, Error>
pub async fn get_default_profile(&self) -> Result<String, Error>
Get the default profile name used when opening the Store
sourcepub async fn set_default_profile(&self, profile: String) -> Result<(), Error>
pub async fn set_default_profile(&self, profile: String) -> Result<(), Error>
Set the default profile name used when opening the Store
sourcepub async fn rekey(
&mut self,
method: StoreKeyMethod,
pass_key: PassKey<'_>
) -> Result<(), Error>
pub async fn rekey( &mut self, method: StoreKeyMethod, pass_key: PassKey<'_> ) -> Result<(), Error>
Replace the wrapping key on a store
sourcepub async fn copy_to(
&self,
target_url: &str,
key_method: StoreKeyMethod,
pass_key: PassKey<'_>,
recreate: bool
) -> Result<Self, Error>
pub async fn copy_to( &self, target_url: &str, key_method: StoreKeyMethod, pass_key: PassKey<'_>, recreate: bool ) -> Result<Self, Error>
Copy to a new store instance using a database URL
sourcepub async fn create_profile(
&self,
name: Option<String>
) -> Result<String, Error>
pub async fn create_profile( &self, name: Option<String> ) -> Result<String, Error>
Create a new profile with the given profile name
sourcepub async fn list_profiles(&self) -> Result<Vec<String>, Error>
pub async fn list_profiles(&self) -> Result<Vec<String>, Error>
Get the details of all store profiles
sourcepub async fn remove_profile(&self, name: String) -> Result<bool, Error>
pub async fn remove_profile(&self, name: String) -> Result<bool, Error>
Remove an existing profile with the given profile name
sourcepub async fn scan(
&self,
profile: Option<String>,
category: Option<String>,
tag_filter: Option<TagFilter>,
offset: Option<i64>,
limit: Option<i64>
) -> Result<Scan<'static, Entry>, Error>
pub async fn scan( &self, profile: Option<String>, category: Option<String>, tag_filter: Option<TagFilter>, offset: Option<i64>, limit: Option<i64> ) -> Result<Scan<'static, Entry>, Error>
Create a new scan instance against the store
The result will keep an open connection to the backend until it is consumed
sourcepub async fn session(&self, profile: Option<String>) -> Result<Session, Error>
pub async fn session(&self, profile: Option<String>) -> Result<Session, Error>
Create a new session against the store