Struct aries_askar::Store

source ·
pub struct Store(/* private fields */);
Expand description

An instance of an opened store

Implementations§

source§

impl Store

source

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

source

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

source

pub async fn remove(db_url: &str) -> Result<bool, Error>

Remove a store instance using a database URL

source

pub fn new_raw_key(seed: Option<&[u8]>) -> Result<PassKey<'static>, Error>

Generate a new raw store key

source

pub fn get_active_profile(&self) -> String

Get the default profile name used when starting a scan or a session

source

pub async fn get_default_profile(&self) -> Result<String, Error>

Get the default profile name used when opening the Store

source

pub async fn set_default_profile(&self, profile: String) -> Result<(), Error>

Set the default profile name used when opening the Store

source

pub async fn rekey( &mut self, method: StoreKeyMethod, pass_key: PassKey<'_> ) -> Result<(), Error>

Replace the wrapping key on a store

source

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

source

pub async fn create_profile( &self, name: Option<String> ) -> Result<String, Error>

Create a new profile with the given profile name

source

pub async fn list_profiles(&self) -> Result<Vec<String>, Error>

Get the details of all store profiles

source

pub async fn remove_profile(&self, name: String) -> Result<bool, Error>

Remove an existing profile with the given profile name

source

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

source

pub async fn session(&self, profile: Option<String>) -> Result<Session, Error>

Create a new session against the store

source

pub async fn transaction( &self, profile: Option<String> ) -> Result<Session, Error>

Create a new transaction session against the store

source

pub async fn close(self) -> Result<(), Error>

Close the store instance, waiting for any shutdown procedures to complete.

Trait Implementations§

source§

impl Clone for Store

source§

fn clone(&self) -> Store

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Store

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<AnyBackend> for Store

source§

fn from(backend: AnyBackend) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more