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 copy_profile_to(
&self,
target: &Store,
from_name: &str,
to_name: &str,
) -> Result<(), Error>
pub async fn copy_profile_to( &self, target: &Store, from_name: &str, to_name: &str, ) -> Result<(), 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 namestore.r
Sourcepub async fn rename_profile(
&self,
from_profile: String,
to_profile: String,
) -> Result<bool, Error>
pub async fn rename_profile( &self, from_profile: String, to_profile: String, ) -> Result<bool, Error>
Change the name of an existing profile
Sourcepub async fn scan(
&self,
profile: Option<String>,
category: Option<String>,
tag_filter: Option<TagFilter>,
offset: Option<i64>,
limit: Option<i64>,
order_by: Option<OrderBy>,
descending: bool,
) -> 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>, order_by: Option<OrderBy>, descending: bool, ) -> 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
Trait Implementations§
Source§impl From<AnyBackend> for Store
impl From<AnyBackend> for Store
Source§fn from(backend: AnyBackend) -> Self
fn from(backend: AnyBackend) -> Self
Auto Trait Implementations§
impl Freeze for Store
impl !RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl !UnwindSafe for Store
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more