pub struct PqxdhProtocolState {
pub(super) protocol: PqxdhInboxProtocol,
pub(super) sessions: BTreeMap<KeyId, PqxdhSession>,
pub(super) inbox_tag: Option<Tag>,
pub(super) inbox: Option<PqxdhInbox>,
pub(super) private_keys: Option<PqxdhPrivateKeys>,
}Expand description
Serializable state for a PQXDH protocol handler
This structure contains all the persistent state needed to restore a
PqxdhProtocolHandler across application restarts. It excludes runtime
dependencies like the messages manager and client keypair, focusing only
on the cryptographic and session state that needs to be preserved.
§Persistence Strategy
This state can be serialized with postcard and stored in a database or file
system. When the application restarts, this state can be loaded and used to
reconstruct a fully functional protocol handler.
§State Components
- Protocol: The specific PQXDH protocol variant being used
- Sessions: Active sessions keyed by target user ID
- Inbox Tag: The published inbox tag (for service providers)
- Private Keys: Cryptographic keys for responding to initial messages
Fields§
§protocol: PqxdhInboxProtocolThe PQXDH protocol variant being used
sessions: BTreeMap<KeyId, PqxdhSession>Active sessions keyed by target user ID
inbox_tag: Option<Tag>§inbox: Option<PqxdhInbox>§private_keys: Option<PqxdhPrivateKeys>Private keys for responding to initial messages (if we’re a service provider)
Implementations§
Source§impl PqxdhProtocolState
impl PqxdhProtocolState
Sourcepub fn new(protocol: PqxdhInboxProtocol) -> Self
pub fn new(protocol: PqxdhInboxProtocol) -> Self
Creates a new empty protocol state
Initializes a new protocol state with the specified protocol variant. All other fields are set to their default empty values.
§Arguments
protocol- The PQXDH protocol variant to use
Trait Implementations§
Source§impl Clone for PqxdhProtocolState
impl Clone for PqxdhProtocolState
Source§fn clone(&self) -> PqxdhProtocolState
fn clone(&self) -> PqxdhProtocolState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more