Struct libsignal_protocol::InMemSignalProtocolStore

source ·
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: InMemSenderKeyStore

Implementations§

source§

impl InMemSignalProtocolStore

source

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.

source

pub fn all_pre_key_ids(&self) -> impl Iterator<Item = &PreKeyId>

Returns all registered pre-key ids

source

pub fn all_signed_pre_key_ids(&self) -> impl Iterator<Item = &SignedPreKeyId>

Returns all registered signed pre-key ids

source

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

source§

fn clone(&self) -> InMemSignalProtocolStore

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

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,

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,

Return a u32 specific to this store instance. Read more
source§

fn save_identity<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, address: &'life1 ProtocolAddress, identity: &'life2 IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<bool>> + '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,

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,

Return the public identity for the given address, if known.
source§

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,

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,

Set the entry for kyber_prekey_id to the value of record.
source§

fn mark_kyber_pre_key_used<'life0, 'async_trait>( &'life0 mut self, kyber_prekey_id: KyberPreKeyId, ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Mark the entry for kyber_prekey_id as “used”. This would mean different things for one-time and last-resort Kyber keys.
source§

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,

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,

Set the entry for prekey_id to the value of record.
source§

fn remove_pre_key<'life0, 'async_trait>( &'life0 mut self, id: PreKeyId, ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove the entry for prekey_id.
source§

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,

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,

Look up the entry corresponding to (sender, distribution_id).
source§

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,

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,

Set the entry for address to the value of record.
source§

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,

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,

Set the entry for signed_prekey_id to the value of record.
source§

impl ProtocolStore for InMemSignalProtocolStore

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V