pub struct MlsPendingMessage {
pub conversation_id: ConversationId,
pub message: Vec<u8>,
}Expand description
Entity representing a buffered message
A message is buffered when it cannot be decrypted yet, which happens in two unrelated situations: the
conversation was joined by external commit and that join has not been merged, or the conversation is
fully established but the message belongs to epoch n + 1 while we are still in epoch n. Both kinds
of conversation are rows in mls_groups, but a message can arrive and be buffered before its
conversation is persisted, so conversation_id holds no foreign key.
This entity cannot be updated in the DB: the primary key is formed of a hash of all the rest of the data, so duplicate save attempts silently succeed without changing anything.
Fields§
§conversation_id: ConversationIdNote that in SQL we do not have a foreign key constraint from conversation_id to the group table.
This is because we can’t avoid the possibility of out-of-order delivery from the DS.
If we receive a pending message from a group that we haven’t joined yet, followed by the commit which
adds us to that group, then we need to still store that message, and that means that a foreign key
would be inappropriate here.
message: Vec<u8>Trait Implementations§
Source§impl Clone for MlsPendingMessage
impl Clone for MlsPendingMessage
Source§fn clone(&self) -> MlsPendingMessage
fn clone(&self) -> MlsPendingMessage
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 MlsPendingMessage
impl Debug for MlsPendingMessage
Source§impl DeletableBySearchKey<ConversationId> for MlsPendingMessage
impl DeletableBySearchKey<ConversationId> for MlsPendingMessage
Source§fn delete_all_matching<'a, Tx>(
tx: &'a Tx,
conversation_id: &ConversationId,
) -> CryptoKeystoreResult<()>
fn delete_all_matching<'a, Tx>( tx: &'a Tx, conversation_id: &ConversationId, ) -> CryptoKeystoreResult<()>
Source§impl DeletableBySearchKey<ConversationIdRef> for MlsPendingMessage
impl DeletableBySearchKey<ConversationIdRef> for MlsPendingMessage
Source§fn delete_all_matching<'a, Tx>(
tx: &'a Tx,
conversation_id: &ConversationIdRef,
) -> CryptoKeystoreResult<()>
fn delete_all_matching<'a, Tx>( tx: &'a Tx, conversation_id: &ConversationIdRef, ) -> CryptoKeystoreResult<()>
Source§impl<'de> Deserialize<'de> for MlsPendingMessage
impl<'de> Deserialize<'de> for MlsPendingMessage
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 Entity for MlsPendingMessage
impl Entity for MlsPendingMessage
Source§const TABLE_NAME: &'static str = "mls_pending_messages"
const TABLE_NAME: &'static str = "mls_pending_messages"
Source§fn get(
conn: &Connection,
key: &Sha256Hash,
) -> CryptoKeystoreResult<Option<Self>>
fn get( conn: &Connection, key: &Sha256Hash, ) -> 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 MlsPendingMessage
impl EntityDatabaseMutation for MlsPendingMessage
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,
primary_key: &Sha256Hash,
) -> CryptoKeystoreResult<bool>
fn delete<'a, Tx>( tx: &'a Tx, primary_key: &Sha256Hash, ) -> CryptoKeystoreResult<bool>
impl Eq for MlsPendingMessage
Source§impl PartialEq for MlsPendingMessage
impl PartialEq for MlsPendingMessage
Source§fn eq(&self, other: &MlsPendingMessage) -> bool
fn eq(&self, other: &MlsPendingMessage) -> bool
self and other values to be equal, and is used by ==.Source§impl PrimaryKey for MlsPendingMessage
impl PrimaryKey for MlsPendingMessage
Source§type PrimaryKey = Sha256Hash
type PrimaryKey = Sha256Hash
PrimaryKey uniquely identifies either 0 or 1 instance. Read moreSource§fn primary_key(&self) -> Self::PrimaryKey
fn primary_key(&self) -> Self::PrimaryKey
Source§impl SearchableEntity<ConversationId> for MlsPendingMessage
impl SearchableEntity<ConversationId> for MlsPendingMessage
Source§fn find_all_matching(
conn: &Connection,
conversation_id: &ConversationId,
) -> CryptoKeystoreResult<Vec<Self>>
fn find_all_matching( conn: &Connection, conversation_id: &ConversationId, ) -> CryptoKeystoreResult<Vec<Self>>
Source§impl SearchableEntity<ConversationIdRef> for MlsPendingMessage
impl SearchableEntity<ConversationIdRef> for MlsPendingMessage
Source§fn find_all_matching(
conn: &Connection,
conversation_id: &ConversationIdRef,
) -> CryptoKeystoreResult<Vec<Self>>
fn find_all_matching( conn: &Connection, conversation_id: &ConversationIdRef, ) -> CryptoKeystoreResult<Vec<Self>>
Source§impl Serialize for MlsPendingMessage
impl Serialize for MlsPendingMessage
impl StructuralPartialEq for MlsPendingMessage
Source§impl ToValue for MlsPendingMessage
impl ToValue for MlsPendingMessage
Auto Trait Implementations§
impl Freeze for MlsPendingMessage
impl RefUnwindSafe for MlsPendingMessage
impl Send for MlsPendingMessage
impl Sync for MlsPendingMessage
impl Unpin for MlsPendingMessage
impl UnsafeUnpin for MlsPendingMessage
impl UnwindSafe for MlsPendingMessage
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.