Struct core_crypto_keystore::connection::Connection
source · pub struct Connection { /* private fields */ }
Implementations§
source§impl Connection
impl Connection
pub async fn open_with_key( name: impl AsRef<str>, key: impl AsRef<str>, ) -> CryptoKeystoreResult<Self>
pub async fn open_in_memory_with_key( name: impl AsRef<str>, key: impl AsRef<str>, ) -> CryptoKeystoreResult<Self>
pub async fn borrow_conn( &self, ) -> CryptoKeystoreResult<MutexGuard<'_, KeystoreDatabaseConnection>>
pub async fn wipe(self) -> CryptoKeystoreResult<()>
pub async fn close(self) -> CryptoKeystoreResult<()>
pub async fn new_transaction(&self) -> CryptoKeystoreResult<()>
pub async fn commit_transaction(&self) -> CryptoKeystoreResult<()>
pub async fn rollback_transaction(&self) -> CryptoKeystoreResult<()>
pub async fn child_groups<E: Entity<ConnectionType = KeystoreDatabaseConnection> + PersistedMlsGroupExt + Sync>( &self, entity: E, ) -> CryptoKeystoreResult<Vec<E>>
pub async fn save<E: Entity<ConnectionType = KeystoreDatabaseConnection> + Sync + EntityTransactionExt>( &self, entity: E, ) -> CryptoKeystoreResult<E>
pub async fn remove<E: Entity<ConnectionType = KeystoreDatabaseConnection> + EntityTransactionExt, S: AsRef<[u8]>>( &self, id: S, ) -> CryptoKeystoreResult<()>
pub async fn cred_delete_by_credential( &self, cred: Vec<u8>, ) -> CryptoKeystoreResult<()>
Trait Implementations§
source§impl Clone for Connection
impl Clone for Connection
source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CryptoKeystoreMls for Connection
impl CryptoKeystoreMls for Connection
source§fn mls_fetch_keypackages<'life0, 'async_trait, V>(
&'life0 self,
count: u32,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<V>>> + Send + 'async_trait>>where
V: 'async_trait + MlsEntity,
Self: 'async_trait,
'life0: 'async_trait,
fn mls_fetch_keypackages<'life0, 'async_trait, V>(
&'life0 self,
count: u32,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<V>>> + Send + 'async_trait>>where
V: 'async_trait + MlsEntity,
Self: 'async_trait,
'life0: 'async_trait,
Fetches Keypackages Read more
source§fn mls_group_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mls_group_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checks if the given MLS group id exists in the keystore
Note: in case of any error, this will return false Read more
source§fn mls_group_persist<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
state: &'life2 [u8],
parent_group_id: Option<&'life3 [u8]>,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn mls_group_persist<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
state: &'life2 [u8],
parent_group_id: Option<&'life3 [u8]>,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Persists a
MlsGroup
Read moresource§fn mls_groups_restore<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<HashMap<Vec<u8>, (Option<Vec<u8>>, Vec<u8>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn mls_groups_restore<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<HashMap<Vec<u8>, (Option<Vec<u8>>, Vec<u8>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads
MlsGroups
from the database. It will be returned as a HashMap
where the key is
the group/conversation id and the value the group state Read moresource§fn mls_group_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mls_group_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes
MlsGroups
from the database. Read moresource§fn mls_pending_groups_save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
mls_group: &'life2 [u8],
custom_configuration: &'life3 [u8],
parent_group_id: Option<&'life4 [u8]>,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn mls_pending_groups_save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
mls_group: &'life2 [u8],
custom_configuration: &'life3 [u8],
parent_group_id: Option<&'life4 [u8]>,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Saves a
MlsGroup
in a temporary table (typically used in scenarios where the group cannot
be committed until the backend acknowledges it, like external commits) Read moresource§fn mls_pending_groups_load<'life0, 'life1, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<(Vec<u8>, Vec<u8>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mls_pending_groups_load<'life0, 'life1, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<(Vec<u8>, Vec<u8>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads a temporary
MlsGroup
and its configuration from the database Read moresource§fn mls_pending_groups_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mls_pending_groups_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
group_id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a temporary
MlsGroup
from the database Read moresource§fn save_e2ei_enrollment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 [u8],
content: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_e2ei_enrollment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 [u8],
content: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Persists an enrollment instance Read more
source§fn pop_e2ei_enrollment<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pop_e2ei_enrollment<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches and delete the enrollment instance Read more
source§impl CryptoKeystoreProteus for Connection
impl CryptoKeystoreProteus for Connection
source§impl Debug for Connection
impl Debug for Connection
source§impl FetchFromDatabase for Connection
impl FetchFromDatabase for Connection
fn find<'life0, 'life1, 'async_trait, E>(
&'life0 self,
id: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Option<E>>> + Send + 'async_trait>>where
E: 'async_trait + Entity<ConnectionType = KeystoreDatabaseConnection>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_unique<'life0, 'async_trait, U>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<U>> + Send + 'async_trait>>where
U: 'async_trait + UniqueEntity,
Self: 'async_trait,
'life0: 'async_trait,
fn find_all<'life0, 'async_trait, E>(
&'life0 self,
params: EntityFindParams,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<E>>> + Send + 'async_trait>>where
E: 'async_trait + Entity<ConnectionType = KeystoreDatabaseConnection>,
Self: 'async_trait,
'life0: 'async_trait,
fn find_many<'life0, 'life1, 'async_trait, E>(
&'life0 self,
ids: &'life1 [Vec<u8>],
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<E>>> + Send + 'async_trait>>where
E: 'async_trait + Entity<ConnectionType = KeystoreDatabaseConnection>,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count<'life0, 'async_trait, E>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<usize>> + Send + 'async_trait>>where
E: 'async_trait + Entity<ConnectionType = KeystoreDatabaseConnection>,
Self: 'async_trait,
'life0: 'async_trait,
source§impl OpenMlsKeyStore for Connection
impl OpenMlsKeyStore for Connection
source§type Error = CryptoKeystoreError
type Error = CryptoKeystoreError
The error type returned by the [
OpenMlsKeyStore
].source§fn store<'life0, 'life1, 'life2, 'async_trait, V>(
&'life0 self,
k: &'life1 [u8],
v: &'life2 V,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
fn store<'life0, 'life1, 'life2, 'async_trait, V>( &'life0 self, k: &'life1 [u8], v: &'life2 V, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
source§fn read<'life0, 'life1, 'async_trait, V>(
&'life0 self,
k: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Option<V>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
V: 'async_trait + MlsEntity,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait, V>(
&'life0 self,
k: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Option<V>> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
V: 'async_trait + MlsEntity,
'life0: 'async_trait,
'life1: 'async_trait,
Read and return a value stored for ID
k
that implements the
[MlsEntity
] trait for deserialization. Read moresource§fn delete<'life0, 'life1, 'async_trait, V>(
&'life0 self,
k: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
V: 'async_trait + MlsEntity,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait, V>(
&'life0 self,
k: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
V: 'async_trait + MlsEntity,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a value stored for ID
k
. Read moresource§impl PreKeyStore for Connection
impl PreKeyStore for Connection
impl Send for Connection
impl Sync for Connection
Auto Trait Implementations§
impl Freeze for Connection
impl !RefUnwindSafe for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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