UnifiedEntity

Trait UnifiedEntity 

Source
pub trait UnifiedEntity: PrimaryKey + Sized {
    const COLLECTION_NAME: &'static str;

    // Required methods
    fn get(
        conn: &Connection,
        key: &Self::PrimaryKey,
    ) -> CryptoKeystoreResult<Option<Self>>;
    fn count(conn: &Connection) -> CryptoKeystoreResult<u32>;
    fn load_all(conn: &Connection) -> CryptoKeystoreResult<Vec<Self>>;
}
Expand description

Something which can be stored in our database.

It has a primary key, which uniquely identifies it.

Required Associated Constants§

Source

const COLLECTION_NAME: &'static str

The table name for this entity

Required Methods§

Source

fn get( conn: &Connection, key: &Self::PrimaryKey, ) -> CryptoKeystoreResult<Option<Self>>

Get an entity by its primary key.

For entites whose primary key has a distinct borrowed type, it is best to implement this as a direct passthrough:

fn get(conn: &Connection, key: &Self::PrimaryKey) -> CoreCryptoKeystoreResult<Option<Self>> {
    Self::get_borrowed(conn, key).await
}
Source

fn count(conn: &Connection) -> CryptoKeystoreResult<u32>

Count the number of entities of this type in the database.

Source

fn load_all(conn: &Connection) -> CryptoKeystoreResult<Vec<Self>>

Retrieve all entities of this type from the database.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl UnifiedEntity for E2eiCrl

Source§

const COLLECTION_NAME: &'static str = "e2ei_crls"

Source§

impl UnifiedEntity for E2eiIntermediateCert

Source§

const COLLECTION_NAME: &'static str = "e2ei_intermediate_certs"

Source§

impl UnifiedEntity for MlsPendingMessage

Source§

const COLLECTION_NAME: &'static str = "mls_pending_messages"

Source§

impl UnifiedEntity for PersistedMlsGroup

Source§

const COLLECTION_NAME: &'static str = "mls_groups"

Source§

impl UnifiedEntity for PersistedMlsPendingGroup

Source§

const COLLECTION_NAME: &'static str = "mls_pending_groups"

Source§

impl UnifiedEntity for ProteusIdentity

Source§

const COLLECTION_NAME: &'static str = "proteus_identities"

Source§

impl UnifiedEntity for ProteusPrekey

Source§

const COLLECTION_NAME: &'static str = "proteus_prekeys"

Source§

impl UnifiedEntity for ProteusSession

Source§

const COLLECTION_NAME: &'static str = "proteus_sessions"

Source§

impl UnifiedEntity for StoredBufferedCommit

Source§

const COLLECTION_NAME: &'static str = "mls_buffered_commits"

Source§

impl UnifiedEntity for StoredCredential

Source§

const COLLECTION_NAME: &'static str = "mls_credentials"

Source§

impl UnifiedEntity for StoredE2eiEnrollment

Source§

const COLLECTION_NAME: &'static str = "e2ei_enrollment"

Source§

impl UnifiedEntity for StoredEncryptionKeyPair

Source§

const COLLECTION_NAME: &'static str = "mls_encryption_keypairs"

Source§

impl UnifiedEntity for StoredEpochEncryptionKeypair

Source§

const COLLECTION_NAME: &'static str = "mls_epoch_encryption_keypairs"

Source§

impl UnifiedEntity for StoredHpkePrivateKey

Source§

const COLLECTION_NAME: &'static str = "mls_hpke_private_keys"

Source§

impl UnifiedEntity for StoredKeypackage

Source§

const COLLECTION_NAME: &'static str = "mls_keypackages"

Source§

impl UnifiedEntity for StoredPskBundle

Source§

const COLLECTION_NAME: &'static str = "mls_psk_bundles"

Source§

impl<T> UnifiedEntity for T

Source§

const COLLECTION_NAME: &'static str = <Self as UnifiedUniqueEntityImplementationHelper>::COLLECTION_NAME