[][src]Struct aries_askar::Session

pub struct Session<Q: QueryBackend>(_);

An active connection to the store backend

Implementations

impl<Q: QueryBackend> Session<Q>[src]

pub async fn count(
    &mut self,
    category: &str,
    tag_filter: Option<TagFilter>
) -> Result<i64, Error>
[src]

Count the number of entries for a given record category

pub async fn fetch(
    &mut self,
    category: &str,
    name: &str,
    for_update: bool
) -> Result<Option<Entry>, Error>
[src]

Retrieve the current record at (category, name).

Specify for_update when in a transaction to create an update lock on the associated record, if supported by the store backend

pub async fn fetch_all(
    &mut self,
    category: &str,
    tag_filter: Option<TagFilter>,
    limit: Option<i64>,
    for_update: bool
) -> Result<Vec<Entry>, Error>
[src]

Retrieve all records matching the given category and tag_filter.

Unlike Store::scan, this method may be used within a transaction. It should not be used for very large result sets due to correspondingly large memory requirements

pub async fn insert(
    &mut self,
    category: &str,
    name: &str,
    value: &[u8],
    tags: Option<&[EntryTag]>,
    expiry_ms: Option<i64>
) -> Result<(), Error>
[src]

Insert a new record into the store

pub async fn remove(&mut self, category: &str, name: &str) -> Result<(), Error>[src]

Remove a record from the store

pub async fn replace(
    &mut self,
    category: &str,
    name: &str,
    value: &[u8],
    tags: Option<&[EntryTag]>,
    expiry_ms: Option<i64>
) -> Result<(), Error>
[src]

Replace the value and tags of a record in the store

pub async fn remove_all(
    &mut self,
    category: &str,
    tag_filter: Option<TagFilter>
) -> Result<i64, Error>
[src]

Remove all records in the store matching a given category and tag_filter

pub async fn update(
    &mut self,
    operation: EntryOperation,
    category: &str,
    name: &str,
    value: Option<&[u8]>,
    tags: Option<&[EntryTag]>,
    expiry_ms: Option<i64>
) -> Result<(), Error>
[src]

Perform a record update

This may correspond to an record insert, replace, or remove depending on the provided operation

pub async fn create_keypair(
    &mut self,
    alg: KeyAlg,
    metadata: Option<&str>,
    seed: Option<&[u8]>,
    tags: Option<&[EntryTag]>
) -> Result<KeyEntry, Error>
[src]

Create a new keypair in the store

pub async fn fetch_key(
    &mut self,
    category: KeyCategory,
    ident: &str,
    for_update: bool
) -> Result<Option<KeyEntry>, Error>
[src]

Fetch an existing key from the store

Specify for_update when in a transaction to create an update lock on the associated record, if supported by the store backend

pub async fn remove_key(
    &mut self,
    category: KeyCategory,
    ident: &str
) -> Result<(), Error>
[src]

Remove an existing key from the store

pub async fn update_key(
    &mut self,
    category: KeyCategory,
    ident: &str,
    metadata: Option<&str>,
    tags: Option<&[EntryTag]>
) -> Result<(), Error>
[src]

Replace the metadata and tags on an existing key in the store

pub async fn sign_message(
    &mut self,
    key_ident: &str,
    data: &[u8]
) -> Result<Vec<u8>, Error>
[src]

Sign a message using an existing keypair in the store identified by key_ident

pub async fn pack_message(
    &mut self,
    recipient_vks: impl IntoIterator<Item = &str>,
    from_key_ident: Option<&str>,
    data: &[u8]
) -> Result<Vec<u8>, Error>
[src]

Pack a message using an existing keypair in the store identified by key_ident

This uses the pack algorithm defined for DIDComm v1

pub async fn unpack_message(
    &mut self,
    data: &[u8]
) -> Result<(Vec<u8>, EncodedVerKey, Option<EncodedVerKey>), Error>
[src]

Unpack a DIDComm v1 message, automatically looking up any associated keypairs

pub async fn commit(self) -> Result<(), Error>[src]

Commit the pending transaction

pub async fn rollback(self) -> Result<(), Error>[src]

Roll back the pending transaction

Trait Implementations

impl<'a, Q: QueryBackend> KeyLookup<'a> for &'a mut Session<Q>[src]

Auto Trait Implementations

impl<Q> RefUnwindSafe for Session<Q> where
    Q: RefUnwindSafe
[src]

impl<Q> Send for Session<Q>[src]

impl<Q> Sync for Session<Q> where
    Q: Sync
[src]

impl<Q> Unpin for Session<Q> where
    Q: Unpin
[src]

impl<Q> UnwindSafe for Session<Q> where
    Q: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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