pub struct KeyRegistry<ID> { /* private fields */ }Expand description
Key registry to maintain public key material of other members we’ve collected.
Implementations§
Source§impl<ID> KeyRegistry<ID>
impl<ID> KeyRegistry<ID>
Sourcepub fn init() -> KeyRegistryState<ID>
pub fn init() -> KeyRegistryState<ID>
Returns newly initialised key-registry state.
Sourcepub fn remove_expired(y: KeyRegistryState<ID>) -> KeyRegistryState<ID>
pub fn remove_expired(y: KeyRegistryState<ID>) -> KeyRegistryState<ID>
Remove all expired key bundles from registry.
Sourcepub fn add_longterm_bundle(
y: KeyRegistryState<ID>,
id: ID,
key_bundle: LongTermKeyBundle,
) -> Result<KeyRegistryState<ID>, KeyRegistryError>
pub fn add_longterm_bundle( y: KeyRegistryState<ID>, id: ID, key_bundle: LongTermKeyBundle, ) -> Result<KeyRegistryState<ID>, KeyRegistryError>
Adds long-term pre-key bundle to the registry.
This throws an error if an expired or invalid bundle was added.
Sourcepub fn add_onetime_bundle(
y: KeyRegistryState<ID>,
id: ID,
key_bundle: OneTimeKeyBundle,
) -> Result<KeyRegistryState<ID>, KeyRegistryError>
pub fn add_onetime_bundle( y: KeyRegistryState<ID>, id: ID, key_bundle: OneTimeKeyBundle, ) -> Result<KeyRegistryState<ID>, KeyRegistryError>
Adds one-time pre-key bundle to the registry.
This throws an error if an expired or invalid bundle was added.
Trait Implementations§
Source§impl<ID: Clone> Clone for KeyRegistry<ID>
impl<ID: Clone> Clone for KeyRegistry<ID>
Source§fn clone(&self) -> KeyRegistry<ID>
fn clone(&self) -> KeyRegistry<ID>
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<ID: Debug> Debug for KeyRegistry<ID>
impl<ID: Debug> Debug for KeyRegistry<ID>
Source§impl<ID> IdentityRegistry<ID, KeyRegistryState<ID>> for KeyRegistry<ID>
impl<ID> IdentityRegistry<ID, KeyRegistryState<ID>> for KeyRegistry<ID>
type Error = Infallible
fn identity_key( y: &KeyRegistryState<ID>, id: &ID, ) -> Result<Option<PublicKey>, Self::Error>
Source§impl<ID> PreKeyRegistry<ID, LongTermKeyBundle> for KeyRegistry<ID>
impl<ID> PreKeyRegistry<ID, LongTermKeyBundle> for KeyRegistry<ID>
type State = KeyRegistryState<ID>
type Error = KeyRegistryError
fn key_bundle( y: Self::State, id: &ID, ) -> Result<(Self::State, Option<LongTermKeyBundle>), Self::Error>
Source§impl<ID> PreKeyRegistry<ID, OneTimeKeyBundle> for KeyRegistry<ID>
impl<ID> PreKeyRegistry<ID, OneTimeKeyBundle> for KeyRegistry<ID>
type State = KeyRegistryState<ID>
type Error = Infallible
fn key_bundle( y: Self::State, id: &ID, ) -> Result<(Self::State, Option<OneTimeKeyBundle>), Self::Error>
Auto Trait Implementations§
impl<ID> Freeze for KeyRegistry<ID>
impl<ID> RefUnwindSafe for KeyRegistry<ID>where
ID: RefUnwindSafe,
impl<ID> Send for KeyRegistry<ID>where
ID: Send,
impl<ID> Sync for KeyRegistry<ID>where
ID: Sync,
impl<ID> Unpin for KeyRegistry<ID>where
ID: Unpin,
impl<ID> UnwindSafe for KeyRegistry<ID>where
ID: UnwindSafe,
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