Skip to main content

OrgKeyTransport

Trait OrgKeyTransport 

Source
pub trait OrgKeyTransport: Send + Sync {
    // Required methods
    fn publish_wrapped(
        &self,
        scope: &str,
        wrapped: &WrappedOrgKey,
    ) -> Result<(), TransportError>;
    fn fetch_wrapped(
        &self,
        scope: &str,
        epoch: u64,
        recipient_user_id: &str,
    ) -> Result<Option<WrappedOrgKey>, TransportError>;
    fn fetch_wrapped_for(
        &self,
        scope: &str,
        recipient_user_id: &str,
    ) -> Result<Vec<WrappedOrgKey>, TransportError>;
    fn publish_pubkey(
        &self,
        scope: &str,
        account_id: &str,
        public_hex: &str,
    ) -> Result<(), TransportError>;
    fn fetch_pubkeys(
        &self,
        scope: &str,
    ) -> Result<Vec<MemberPublicKey>, TransportError>;
}
Expand description

The scope-keyed wire form of crate::org_key_directory::OrgKeyDirectory — the org-key analogue of SyncTransport. Kept SEPARATE from SyncTransport for the same reason the local directory is separate from Relay: org-key blobs are a key-value directory, not oplog ops, and routing them around the op stream keeps the frontier/GC invariants clean. One backend (e.g. LoopbackTransport, and later ParsleeSyncTransport) implements BOTH traits over the same scope: "org:<id>" tenant key.

Every method takes a leading scope; a NetworkOrgKeyDirectory binds one scope and adapts this into the local OrgKeyDirectory trait (the NetworkRelay analogue).

Required Methods§

Source

fn publish_wrapped( &self, scope: &str, wrapped: &WrappedOrgKey, ) -> Result<(), TransportError>

Source

fn fetch_wrapped( &self, scope: &str, epoch: u64, recipient_user_id: &str, ) -> Result<Option<WrappedOrgKey>, TransportError>

Source

fn fetch_wrapped_for( &self, scope: &str, recipient_user_id: &str, ) -> Result<Vec<WrappedOrgKey>, TransportError>

Source

fn publish_pubkey( &self, scope: &str, account_id: &str, public_hex: &str, ) -> Result<(), TransportError>

Source

fn fetch_pubkeys( &self, scope: &str, ) -> Result<Vec<MemberPublicKey>, TransportError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§