pub struct InMemoryOrgKeyDirectory { /* private fields */ }Expand description
In-memory reference — tests and in-process coordination (the
crate::relay::InMemoryRelay analogue).
Implementations§
Trait Implementations§
Source§impl Clone for InMemoryOrgKeyDirectory
impl Clone for InMemoryOrgKeyDirectory
Source§fn clone(&self) -> InMemoryOrgKeyDirectory
fn clone(&self) -> InMemoryOrgKeyDirectory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryOrgKeyDirectory
impl Debug for InMemoryOrgKeyDirectory
Source§impl Default for InMemoryOrgKeyDirectory
impl Default for InMemoryOrgKeyDirectory
Source§fn default() -> InMemoryOrgKeyDirectory
fn default() -> InMemoryOrgKeyDirectory
Returns the “default value” for a type. Read more
Source§impl OrgKeyDirectory for InMemoryOrgKeyDirectory
impl OrgKeyDirectory for InMemoryOrgKeyDirectory
Source§fn publish_wrapped(
&mut self,
wrapped: &WrappedOrgKey,
) -> Result<(), OrgKeyDirectoryError>
fn publish_wrapped( &mut self, wrapped: &WrappedOrgKey, ) -> Result<(), OrgKeyDirectoryError>
Publish (or replace) the wrap for
(wrapped.epoch, wrapped.recipient).
Last-write-wins — re-publishing a fresh wrap of the same K_org
(a new ephemeral each time) for a recipient is expected and benign.Source§fn fetch_wrapped(
&self,
epoch: u64,
recipient_user_id: &str,
) -> Result<Option<WrappedOrgKey>, OrgKeyDirectoryError>
fn fetch_wrapped( &self, epoch: u64, recipient_user_id: &str, ) -> Result<Option<WrappedOrgKey>, OrgKeyDirectoryError>
Fetch the wrap addressed to
recipient_user_id at exactly epoch, if
one has been published. Reads are pure (&self) — unlike
crate::relay::Relay, this type has no per-call roster/checkpoint
reconciliation, so a fetch never rewrites state (the fs reference takes a
shared lock and returns; no fsync-on-read).Source§fn fetch_wrapped_for(
&self,
recipient_user_id: &str,
) -> Result<Vec<WrappedOrgKey>, OrgKeyDirectoryError>
fn fetch_wrapped_for( &self, recipient_user_id: &str, ) -> Result<Vec<WrappedOrgKey>, OrgKeyDirectoryError>
Every wrap addressed to
recipient_user_id, newest epoch first — the
client picks the highest epoch it can crate::crypto::unwrap_org_key.Source§fn publish_pubkey(
&mut self,
account_id: &str,
public_hex: &str,
) -> Result<(), OrgKeyDirectoryError>
fn publish_pubkey( &mut self, account_id: &str, public_hex: &str, ) -> Result<(), OrgKeyDirectoryError>
Publish (or replace)
account_id’s X25519 public key.Source§fn fetch_pubkeys(&self) -> Result<Vec<MemberPublicKey>, OrgKeyDirectoryError>
fn fetch_pubkeys(&self) -> Result<Vec<MemberPublicKey>, OrgKeyDirectoryError>
Every member public key in this directory, ordered by
account_id.Auto Trait Implementations§
impl Freeze for InMemoryOrgKeyDirectory
impl RefUnwindSafe for InMemoryOrgKeyDirectory
impl Send for InMemoryOrgKeyDirectory
impl Sync for InMemoryOrgKeyDirectory
impl Unpin for InMemoryOrgKeyDirectory
impl UnsafeUnpin for InMemoryOrgKeyDirectory
impl UnwindSafe for InMemoryOrgKeyDirectory
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