Skip to main content

PrimaryKey

Trait PrimaryKey 

Source
pub trait PrimaryKey {
    type PrimaryKey: DynEntityId + Clone;

    // Required method
    fn primary_key(&self) -> Self::PrimaryKey;
}
Expand description

Something which has a distinct primary key which can uniquely identify it.

Required Associated Types§

Source

type PrimaryKey: DynEntityId + Clone

Each distinct PrimaryKey uniquely identifies either 0 or 1 instance.

This constraint should be enforced at the DB level.

Required Methods§

Source

fn primary_key(&self) -> Self::PrimaryKey

Get this entity’s primary key.

This must return an owned type, because there are some entities for which only owned primary keys are possible. However, entities which have primary keys owned within the entity itself should consider also implementing BorrowPrimaryKey for greater efficiency.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl PrimaryKey for MlsPendingMessage

Source§

impl PrimaryKey for PersistedMlsGroup

Source§

impl PrimaryKey for ProteusIdentity

Source§

impl PrimaryKey for ProteusPrekey

Source§

impl PrimaryKey for ProteusSession

Source§

impl PrimaryKey for StoredBufferedCommit

Source§

impl PrimaryKey for StoredCredential

Source§

impl PrimaryKey for StoredEncryptionKeyPair

Source§

impl PrimaryKey for StoredEpochEncryptionKeypair

Source§

impl PrimaryKey for StoredHpkePrivateKey

Source§

impl PrimaryKey for StoredKeyPackage

Source§

impl PrimaryKey for StoredPskBundle

Source§

impl PrimaryKey for TargetedMessageRxCounter

Source§

impl PrimaryKey for TntMessageTxCounter

Source§

impl PrimaryKey for TntSecret

Source§

impl PrimaryKey for TransientMessageRxCounter

Source§

impl PrimaryKey for X509Crl

Source§

impl PrimaryKey for X509IntermediateCert

Source§

impl PrimaryKey for X509TrustAnchor

Source§

impl<T> PrimaryKey for T