pub struct PersistedMlsGroup {
pub id: ConversationId,
pub state: Vec<u8>,
pub epoch: u64,
pub ciphersuite: u16,
pub credential_id: Sha256Hash,
pub credential_type: u16,
pub own_leaf_index: u32,
pub is_pending: bool,
pub tnt_tx_counter: u32,
}Expand description
Entity representing a persisted MlsGroup
Fields§
§id: ConversationId§state: Vec<u8>§epoch: u64§ciphersuite: u16§credential_id: Sha256HashHash of the public key of the credential currently in use by our leaf node, if one
can be determined. None if the group’s leaf node has been removed, or if that
credential is no longer present in mls_credentials.
credential_type: u16The type of the credential identified by credential_id. mls_credentials’s primary key
is (public_key_sha256, credential_type), not public_key_sha256 alone, so this always
travels alongside credential_id: both are Some or both are None.
own_leaf_index: u32§is_pending: boolDistinguishes a group joined by external commit but not yet merged from an established one.
tnt_tx_counter: u32Counter for outbound TNT messages
Implementations§
Source§impl PersistedMlsGroup
impl PersistedMlsGroup
Sourcepub fn delete_if_pending<'a, Tx>(
tx: &'a Tx,
id: &ConversationIdRef,
) -> CryptoKeystoreResult<bool>
pub fn delete_if_pending<'a, Tx>( tx: &'a Tx, id: &ConversationIdRef, ) -> CryptoKeystoreResult<bool>
Delete this group only if it is still marked pending.
A pending group and the established group it eventually becomes share a row. Abandoning a pending join must not delete an established group which has since superseded it. This accomplishes that while avoiding TOCTOU issues.
Trait Implementations§
Source§impl BorrowPrimaryKey for PersistedMlsGroup
impl BorrowPrimaryKey for PersistedMlsGroup
type BorrowedPrimaryKey<'a> = &'a ConversationIdRef
Source§fn borrow_primary_key(&self) -> Self::BorrowedPrimaryKey<'_>
fn borrow_primary_key(&self) -> Self::BorrowedPrimaryKey<'_>
Source§impl Clone for PersistedMlsGroup
impl Clone for PersistedMlsGroup
Source§fn clone(&self) -> PersistedMlsGroup
fn clone(&self) -> PersistedMlsGroup
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PersistedMlsGroup
impl Debug for PersistedMlsGroup
Source§impl<'de> Deserialize<'de> for PersistedMlsGroup
impl<'de> Deserialize<'de> for PersistedMlsGroup
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Drop for PersistedMlsGroup
impl Drop for PersistedMlsGroup
Source§impl Entity for PersistedMlsGroup
impl Entity for PersistedMlsGroup
Source§const TABLE_NAME: &'static str = "mls_groups"
const TABLE_NAME: &'static str = "mls_groups"
Source§fn get(
conn: &Connection,
key: &Self::PrimaryKey,
) -> CryptoKeystoreResult<Option<Self>>
fn get( conn: &Connection, key: &Self::PrimaryKey, ) -> CryptoKeystoreResult<Option<Self>>
Source§fn count(conn: &Connection) -> CryptoKeystoreResult<u32>
fn count(conn: &Connection) -> CryptoKeystoreResult<u32>
Source§fn load_all(conn: &Connection) -> CryptoKeystoreResult<Vec<Self>>
fn load_all(conn: &Connection) -> CryptoKeystoreResult<Vec<Self>>
Source§impl EntityDatabaseMutation for PersistedMlsGroup
impl EntityDatabaseMutation for PersistedMlsGroup
Source§fn save<'a, Tx>(&self, tx: &'a Tx) -> CryptoKeystoreResult<()>
fn save<'a, Tx>(&self, tx: &'a Tx) -> CryptoKeystoreResult<()>
Source§fn delete<'a, Tx>(tx: &'a Tx, id: &ConversationId) -> CryptoKeystoreResult<bool>
fn delete<'a, Tx>(tx: &'a Tx, id: &ConversationId) -> CryptoKeystoreResult<bool>
Source§impl EntityDeleteBorrowed for PersistedMlsGroup
impl EntityDeleteBorrowed for PersistedMlsGroup
Source§fn delete_borrowed<'a, Tx>(
tx: &'a Tx,
id: &ConversationIdRef,
) -> CryptoKeystoreResult<bool>
fn delete_borrowed<'a, Tx>( tx: &'a Tx, id: &ConversationIdRef, ) -> CryptoKeystoreResult<bool>
Source§impl EntityGetBorrowed for PersistedMlsGroup
impl EntityGetBorrowed for PersistedMlsGroup
Source§fn get_borrowed(
conn: &Connection,
key: Self::BorrowedPrimaryKey<'_>,
) -> CryptoKeystoreResult<Option<Self>>
fn get_borrowed( conn: &Connection, key: Self::BorrowedPrimaryKey<'_>, ) -> CryptoKeystoreResult<Option<Self>>
impl Eq for PersistedMlsGroup
Source§impl PartialEq for PersistedMlsGroup
impl PartialEq for PersistedMlsGroup
Source§fn eq(&self, other: &PersistedMlsGroup) -> bool
fn eq(&self, other: &PersistedMlsGroup) -> bool
self and other values to be equal, and is used by ==.Source§impl PrimaryKey for PersistedMlsGroup
impl PrimaryKey for PersistedMlsGroup
Source§type PrimaryKey = ConversationId
type PrimaryKey = ConversationId
PrimaryKey uniquely identifies either 0 or 1 instance. Read moreSource§fn primary_key(&self) -> Self::PrimaryKey
fn primary_key(&self) -> Self::PrimaryKey
Source§impl Serialize for PersistedMlsGroup
impl Serialize for PersistedMlsGroup
impl StructuralPartialEq for PersistedMlsGroup
Auto Trait Implementations§
impl Freeze for PersistedMlsGroup
impl RefUnwindSafe for PersistedMlsGroup
impl Send for PersistedMlsGroup
impl Sync for PersistedMlsGroup
impl Unpin for PersistedMlsGroup
impl UnsafeUnpin for PersistedMlsGroup
impl UnwindSafe for PersistedMlsGroup
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.