pub struct FsOrgKeyDirectory { /* private fields */ }Expand description
Fs-backed reference — one directory of one org’s wraps + member pubkeys,
the crate::relay::FsRelay analogue (the realistic single-host / shared
dir). Every mutation runs under an exclusive lock file and persists the
whole state via temp-write + fsync + atomic rename, matching FsRelay.
Implementations§
Trait Implementations§
Source§impl Debug for FsOrgKeyDirectory
impl Debug for FsOrgKeyDirectory
Source§impl OrgKeyDirectory for FsOrgKeyDirectory
impl OrgKeyDirectory for FsOrgKeyDirectory
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 FsOrgKeyDirectory
impl RefUnwindSafe for FsOrgKeyDirectory
impl Send for FsOrgKeyDirectory
impl Sync for FsOrgKeyDirectory
impl Unpin for FsOrgKeyDirectory
impl UnsafeUnpin for FsOrgKeyDirectory
impl UnwindSafe for FsOrgKeyDirectory
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