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§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>
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>
Auto Trait Implementations§
impl<ID> Freeze for KeyRegistry<ID>where
PhantomData<ID>: Freeze,
impl<ID> RefUnwindSafe for KeyRegistry<ID>where
PhantomData<ID>: RefUnwindSafe,
impl<ID> Send for KeyRegistry<ID>where
PhantomData<ID>: Send,
impl<ID> Sync for KeyRegistry<ID>where
PhantomData<ID>: Sync,
impl<ID> Unpin for KeyRegistry<ID>where
PhantomData<ID>: Unpin,
impl<ID> UnsafeUnpin for KeyRegistry<ID>where
PhantomData<ID>: UnsafeUnpin,
impl<ID> UnwindSafe for KeyRegistry<ID>where
PhantomData<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