Skip to main content

Crate offline_protocol

Crate offline_protocol 

Source
Expand description

Main protocol engine for the Offline Protocol SDK.

This crate ties together all the components (core, transport, router, reliability) into a single easy-to-use API.

All code in this crate is 100% safe Rust with no unsafe blocks.

Re-exports§

pub use config::CustodyConfig;
pub use config::DataConfig;
pub use config::EncryptionConfig;
pub use config::GroupConfig;
pub use config::OverflowPolicy;
pub use config::PendingQueueConfig;
pub use config::ProtocolConfig;
pub use config::SecurityConfig;
pub use config::CUSTODY_MIN_BYTES_PER_DEPOSITOR;
pub use config::DEFAULT_CUSTODY_HOLD_MS;
pub use config::DEFAULT_PENDING_TTL_MS;
pub use error::Error;
pub use error::EstablishmentState;
pub use error::Result;
pub use error::SessionStateError;
pub use events::DecryptionFailureCode;
pub use events::DocRemovedBy;
pub use events::DorsEscalationPhase;
pub use events::DorsEscalationReasonCode;
pub use events::DorsReasonCode;
pub use events::Event;
pub use events::EventCallback;
pub use events::GroupInfoMember;
pub use events::PresenceSource;
pub use events::PresenceStatus;
pub use events::UserGroupSummary;
pub use file_store::account_storage_namespace;
pub use file_store::EnvStoreKey;
pub use file_store::FileProtocolStateStorage;
pub use file_store::FileStoreError;
pub use file_store::FileStorePair;
pub use file_store::SealedFileMlsStorage;
pub use file_store::SealedState;
pub use file_store::StaticStoreKey;
pub use file_store::StoreKeyError;
pub use file_store::StoreKeyProvider;
pub use protocol::GatewayCarrier;
pub use protocol::MediaSendOptions;
pub use protocol::OfflineProtocol;
pub use protocol::SendMessageOptions;
pub use protocol_state_storage::ProtocolStateError;
pub use protocol_state_storage::ProtocolStateResult;
pub use protocol_state_storage::ProtocolStateStorage;
pub use protocol_state_storage::MAX_PROTOCOL_STATE_RECORD_TRANSFER_BYTES;
pub use transport_manager::TransportManager;
pub use visualization::MessageStats;
pub use visualization::NetworkNode;
pub use visualization::NetworkTopology;
pub use visualization::NetworkVisualizer;
pub use visualization::NodeRole;
pub use mls_observability::DecryptionFailureKind;
pub use mls_observability::MlsErrorCategory;
pub use mls_observability::MlsEventEmitter;
pub use mls_observability::MlsLifecycleEvent;
pub use mls_observability::MlsOperationContext;
pub use mls_observability::NoopMlsEventEmitter;
pub use telemetry::AppState;
pub use telemetry::TelemetryHost;
pub use telemetry::TelemetryOs;
pub use telemetry::TelemetryPipe;
pub use telemetry::TelemetryStats;
pub use telemetry::DeviceCapabilitySnapshot;
pub use telemetry::MetricsFrame;
pub use telemetry::MlsVerbosity;
pub use telemetry::NoopTelemetrySink;
pub use telemetry::RoutingDecision;
pub use telemetry::RoutingPhase;
pub use telemetry::RoutingReasonCode;
pub use telemetry::TelemetryConfig;
pub use telemetry::TelemetryRecord;
pub use telemetry::TelemetrySink;
pub use telemetry::TransportStateEvent;

Modules§

config
Protocol configuration.
constants
Constants used throughout the offline-protocol crate.
error
Protocol errors.
events
Event types and callbacks.
file_store
Built-in file-backed stores, for a host with a filesystem and no platform keystore.
file_transfer
File transfer with chunking and reassembly.
mls
MLS (Message Layer Security) integration for end-to-end encryption.
mls_observability
MLS lifecycle observability primitives.
mls_storage_conformance
The conformance suite for mls::MlsStorage implementations, beside the protocol-state one, so a Rust host verifies both backends from here. A portable conformance suite for MlsStorage implementations.
protocol
Main protocol engine.
protocol_state_storage
Install-scoped storage for protocol delivery state.
storage_conformance
A portable conformance suite for ProtocolStateStorage implementations.
telemetry
Telemetry primitives for the Offline Protocol SDK.
transport_manager
Transport management for multi-transport protocol.
visualization
Network visualization and topology export.

Structs§

AckConfig
Configuration for ACK management.
CustodyStats
What a custodian has done, and is holding.
DeduplicatorConfig
Configuration for deduplication.
DeduplicatorStats
Statistics about the deduplicator.
EncryptedMessage
The sealed-envelope types, re-exported so that every path into them keeps working and there is still exactly one definition of each.
GroupId
The sealed-envelope types, re-exported so that every path into them keeps working and there is still exactly one definition of each.
GroupInfo
Information about an MLS group.
GroupRichReadiness
Snapshot of whether a rich group send right now would seal its extras, from OfflineProtocol::group_rich_readiness. Point-in-time and advisory: capability knowledge changes with key-package exchanges, attested adds, and restarts, and the send path re-evaluates the gate itself — this exists so apps can warn before sending (e.g. gray out the attachment button) instead of learning from GroupRichExtrasDropped after the drop.
GroupSendOptions
Options for OfflineProtocol::send_group_message_with: priority and reply threading (as on send_group_message), plus the rich media fields.
KeyPackageBundle
A bundle containing a key package and metadata for distribution.
MeshRelayConfig
Tunables for mesh forwarding.
MeshRelayStats
What this device has carried for other people.
MeshServices
Mesh service registry and message handler.
MlsManager
Main MLS manager for end-to-end encryption.
RetryConfig
Configuration for retry behavior.
RetryQueueStats
Statistics about the retry queue.
WelcomeMessage
The sealed-envelope types, re-exported so that every path into them keeps working and there is still exactly one definition of each.

Enums§

CustodyRefusal
Why a frame at the drop point was not taken into custody, in the order the chapter’s acceptance table applies them.
DataValue
Replicated-document types.
DeduplicatorMode
The mode of operation for the deduplicator.
RelaySyncState
Relay-side registration state of a group, from OfflineProtocol::group_relay_sync_state. Point-in-time: transitions are surfaced as GroupRelaySyncChanged events.

Constants§

DOC_SIZE_WARN_BYTES
Replicated-document types.
MAX_DOC_BYTES
Replicated-document types.
MAX_RELAY_CAPABILITIES
Upper bound on stored relay capability tokens, and on the byte length of each token. The list is wire-supplied by the relay — bounded so a hostile or broken relay cannot grow resident memory with it.
MAX_RELAY_CAPABILITY_TOKEN_BYTES
See MAX_RELAY_CAPABILITIES.
MAX_VALUE_BYTES
Replicated-document types.

Traits§

MlsStorage
Trait for MLS key material storage.