pub struct InMemSignalProtocolStore {
    pub session_store: InMemSessionStore,
    pub pre_key_store: InMemPreKeyStore,
    pub signed_pre_key_store: InMemSignedPreKeyStore,
    pub kyber_pre_key_store: InMemKyberPreKeyStore,
    pub identity_store: InMemIdentityKeyStore,
    pub sender_key_store: InMemSenderKeyStore,
}Expand description
Reference implementation of traits::ProtocolStore.
Fields§
§session_store: InMemSessionStore§pre_key_store: InMemPreKeyStore§signed_pre_key_store: InMemSignedPreKeyStore§kyber_pre_key_store: InMemKyberPreKeyStore§identity_store: InMemIdentityKeyStore§sender_key_store: InMemSenderKeyStoreImplementations§
Source§impl InMemSignalProtocolStore
 
impl InMemSignalProtocolStore
Sourcepub fn new(key_pair: IdentityKeyPair, registration_id: u32) -> Result<Self>
 
pub fn new(key_pair: IdentityKeyPair, registration_id: u32) -> Result<Self>
Create an object with the minimal implementation of traits::ProtocolStore, representing
the given identity key_pair along with the separate randomly chosen registration_id.
Sourcepub fn all_pre_key_ids(&self) -> impl Iterator<Item = &PreKeyId>
 
pub fn all_pre_key_ids(&self) -> impl Iterator<Item = &PreKeyId>
Returns all registered pre-key ids
Sourcepub fn all_signed_pre_key_ids(&self) -> impl Iterator<Item = &SignedPreKeyId>
 
pub fn all_signed_pre_key_ids(&self) -> impl Iterator<Item = &SignedPreKeyId>
Returns all registered signed pre-key ids
Sourcepub fn all_kyber_pre_key_ids(&self) -> impl Iterator<Item = &KyberPreKeyId>
 
pub fn all_kyber_pre_key_ids(&self) -> impl Iterator<Item = &KyberPreKeyId>
Returns all registered Kyber pre-key ids
Trait Implementations§
Source§impl Clone for InMemSignalProtocolStore
 
impl Clone for InMemSignalProtocolStore
Source§fn clone(&self) -> InMemSignalProtocolStore
 
fn clone(&self) -> InMemSignalProtocolStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl IdentityKeyStore for InMemSignalProtocolStore
 
impl IdentityKeyStore for InMemSignalProtocolStore
Source§fn get_identity_key_pair<'life0, 'async_trait>(
    &'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IdentityKeyPair>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn get_identity_key_pair<'life0, 'async_trait>(
    &'life0 self,
) -> Pin<Box<dyn Future<Output = Result<IdentityKeyPair>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Return the single specific identity the store is assumed to represent, with private key.
Source§fn get_local_registration_id<'life0, 'async_trait>(
    &'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn get_local_registration_id<'life0, 'async_trait>(
    &'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Source§fn save_identity<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    address: &'life1 ProtocolAddress,
    identity: &'life2 IdentityKey,
) -> Pin<Box<dyn Future<Output = Result<IdentityChange>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn save_identity<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    address: &'life1 ProtocolAddress,
    identity: &'life2 IdentityKey,
) -> Pin<Box<dyn Future<Output = Result<IdentityChange>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
Record an identity into the store. The identity is then considered “trusted”. Read more
Source§fn is_trusted_identity<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    address: &'life1 ProtocolAddress,
    identity: &'life2 IdentityKey,
    direction: Direction,
) -> Pin<Box<dyn Future<Output = Result<bool>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn is_trusted_identity<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    address: &'life1 ProtocolAddress,
    identity: &'life2 IdentityKey,
    direction: Direction,
) -> Pin<Box<dyn Future<Output = Result<bool>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
Return whether an identity is trusted for the role specified by 
direction.Source§fn get_identity<'life0, 'life1, 'async_trait>(
    &'life0 self,
    address: &'life1 ProtocolAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<IdentityKey>>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn get_identity<'life0, 'life1, 'async_trait>(
    &'life0 self,
    address: &'life1 ProtocolAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<IdentityKey>>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Return the public identity for the given 
address, if known.Source§impl KyberPreKeyStore for InMemSignalProtocolStore
 
impl KyberPreKeyStore for InMemSignalProtocolStore
Source§fn get_kyber_pre_key<'life0, 'async_trait>(
    &'life0 self,
    kyber_prekey_id: KyberPreKeyId,
) -> Pin<Box<dyn Future<Output = Result<KyberPreKeyRecord>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn get_kyber_pre_key<'life0, 'async_trait>(
    &'life0 self,
    kyber_prekey_id: KyberPreKeyId,
) -> Pin<Box<dyn Future<Output = Result<KyberPreKeyRecord>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Look up the signed kyber pre-key corresponding to 
kyber_prekey_id.Source§fn save_kyber_pre_key<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    kyber_prekey_id: KyberPreKeyId,
    record: &'life1 KyberPreKeyRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn save_kyber_pre_key<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    kyber_prekey_id: KyberPreKeyId,
    record: &'life1 KyberPreKeyRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Set the entry for 
kyber_prekey_id to the value of record.Source§fn mark_kyber_pre_key_used<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    kyber_prekey_id: KyberPreKeyId,
    ec_prekey_id: SignedPreKeyId,
    base_key: &'life1 PublicKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn mark_kyber_pre_key_used<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    kyber_prekey_id: KyberPreKeyId,
    ec_prekey_id: SignedPreKeyId,
    base_key: &'life1 PublicKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Mark the entry for 
kyber_prekey_id as “used”. Read moreSource§impl PreKeyStore for InMemSignalProtocolStore
 
impl PreKeyStore for InMemSignalProtocolStore
Source§fn get_pre_key<'life0, 'async_trait>(
    &'life0 self,
    id: PreKeyId,
) -> Pin<Box<dyn Future<Output = Result<PreKeyRecord>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn get_pre_key<'life0, 'async_trait>(
    &'life0 self,
    id: PreKeyId,
) -> Pin<Box<dyn Future<Output = Result<PreKeyRecord>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Look up the pre-key corresponding to 
prekey_id.Source§fn save_pre_key<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    id: PreKeyId,
    record: &'life1 PreKeyRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn save_pre_key<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    id: PreKeyId,
    record: &'life1 PreKeyRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Set the entry for 
prekey_id to the value of record.Source§impl SenderKeyStore for InMemSignalProtocolStore
 
impl SenderKeyStore for InMemSignalProtocolStore
Source§fn store_sender_key<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    sender: &'life1 ProtocolAddress,
    distribution_id: Uuid,
    record: &'life2 SenderKeyRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn store_sender_key<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    sender: &'life1 ProtocolAddress,
    distribution_id: Uuid,
    record: &'life2 SenderKeyRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
Assign 
record to the entry for (sender, distribution_id).Source§fn load_sender_key<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    sender: &'life1 ProtocolAddress,
    distribution_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<SenderKeyRecord>>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn load_sender_key<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    sender: &'life1 ProtocolAddress,
    distribution_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<SenderKeyRecord>>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Look up the entry corresponding to 
(sender, distribution_id).Source§impl SessionStore for InMemSignalProtocolStore
 
impl SessionStore for InMemSignalProtocolStore
Source§fn load_session<'life0, 'life1, 'async_trait>(
    &'life0 self,
    address: &'life1 ProtocolAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionRecord>>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn load_session<'life0, 'life1, 'async_trait>(
    &'life0 self,
    address: &'life1 ProtocolAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionRecord>>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Look up the session corresponding to 
address.Source§fn store_session<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    address: &'life1 ProtocolAddress,
    record: &'life2 SessionRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn store_session<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    address: &'life1 ProtocolAddress,
    record: &'life2 SessionRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
Set the entry for 
address to the value of record.Source§impl SignedPreKeyStore for InMemSignalProtocolStore
 
impl SignedPreKeyStore for InMemSignalProtocolStore
Source§fn get_signed_pre_key<'life0, 'async_trait>(
    &'life0 self,
    id: SignedPreKeyId,
) -> Pin<Box<dyn Future<Output = Result<SignedPreKeyRecord>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn get_signed_pre_key<'life0, 'async_trait>(
    &'life0 self,
    id: SignedPreKeyId,
) -> Pin<Box<dyn Future<Output = Result<SignedPreKeyRecord>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Look up the signed pre-key corresponding to 
signed_prekey_id.Source§fn save_signed_pre_key<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    id: SignedPreKeyId,
    record: &'life1 SignedPreKeyRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn save_signed_pre_key<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    id: SignedPreKeyId,
    record: &'life1 SignedPreKeyRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Set the entry for 
signed_prekey_id to the value of record.impl ProtocolStore for InMemSignalProtocolStore
Auto Trait Implementations§
impl Freeze for InMemSignalProtocolStore
impl RefUnwindSafe for InMemSignalProtocolStore
impl Send for InMemSignalProtocolStore
impl Sync for InMemSignalProtocolStore
impl Unpin for InMemSignalProtocolStore
impl UnwindSafe for InMemSignalProtocolStore
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more