EntityBase

Trait EntityBase 

Source
pub trait EntityBase: 'static + Sized {
    type ConnectionType: for<'a> DatabaseConnection<'a>;

    const COLLECTION_NAME: &'static str;

    // Required method
    fn to_transaction_entity(self) -> Entity;

    // Provided methods
    fn downcast<T: EntityBase>(&self) -> Option<&T> { ... }
    fn downcast_arc<T>(self: Arc<Self>) -> Option<Arc<T>>
       where Self: Send + Sync,
             T: EntityBase + Send + Sync { ... }
}
Expand description

A supertrait that all entities must implement. This handles multiplexing over the two different database backends.

This trait should be removed once the persistence layers are unified. See WPB-16241.

Required Associated Constants§

Source

const COLLECTION_NAME: &'static str

Beware: if you change the value of this constant on any WASM entity, you’ll need to do a data migration not only because it is used as reference to the object store names but also for the value of the aad.

Required Associated Types§

Required Methods§

Source

fn to_transaction_entity(self) -> Entity

Provided Methods§

Source

fn downcast<T: EntityBase>(&self) -> Option<&T>

Source

fn downcast_arc<T>(self: Arc<Self>) -> Option<Arc<T>>
where Self: Send + Sync, T: EntityBase + Send + Sync,

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 EntityBase for ConsumerData

Source§

impl EntityBase for E2eiAcmeCA

Source§

impl EntityBase for E2eiCrl

Source§

impl EntityBase for E2eiIntermediateCert

Source§

const COLLECTION_NAME: &'static str = "e2ei_intermediate_certs"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for MlsPendingMessage

Source§

const COLLECTION_NAME: &'static str = "mls_pending_messages"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for PersistedMlsGroup

Source§

impl EntityBase for PersistedMlsPendingGroup

Source§

const COLLECTION_NAME: &'static str = "mls_pending_groups"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for ProteusIdentity

Source§

const COLLECTION_NAME: &'static str = "proteus_identities"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for ProteusPrekey

Source§

const COLLECTION_NAME: &'static str = "proteus_prekeys"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for ProteusSession

Source§

const COLLECTION_NAME: &'static str = "proteus_sessions"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for StoredBufferedCommit

Source§

const COLLECTION_NAME: &'static str = "mls_buffered_commits"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for StoredCredential

Source§

const COLLECTION_NAME: &'static str = "mls_credentials"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for StoredE2eiEnrollment

Source§

const COLLECTION_NAME: &'static str = "e2ei_enrollment"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for StoredEncryptionKeyPair

Source§

const COLLECTION_NAME: &'static str = "mls_encryption_keypairs"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for StoredEpochEncryptionKeypair

Source§

const COLLECTION_NAME: &'static str = "mls_epoch_encryption_keypairs"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for StoredHpkePrivateKey

Source§

const COLLECTION_NAME: &'static str = "mls_hpke_private_keys"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for StoredKeypackage

Source§

const COLLECTION_NAME: &'static str = "mls_keypackages"

Source§

type ConnectionType = SqlCipherConnection

Source§

impl EntityBase for StoredPskBundle

Source§

const COLLECTION_NAME: &'static str = "mls_psk_bundles"

Source§

type ConnectionType = SqlCipherConnection