pub struct ProtocolConfig {
pub app_id: String,
pub profile: String,
pub transport: TransportConfig,
pub dors: DorsConfig,
pub relay: RelayConfig,
pub mesh_relay: MeshRelayConfig,
pub path: PathConfig,
pub reliability: ReliabilityConfig,
pub encryption: EncryptionConfig,
pub initial_ttl: u8,
pub group: GroupConfig,
pub security: SecurityConfig,
}Expand description
Main configuration for the Offline Protocol.
Fields§
§app_id: StringApplication identifier (required).
profile: StringLocal profile selector (required).
Selects which stored identity this instance runs as — one namespace per
(app_id, profile) pair — so an app hosting several accounts gives each
its own value, and an app hosting one can pass a constant like
"default".
It is not the device’s identity. The wire identity is the
self-certifying address derived from the identity key held in this
profile’s storage: it is minted on first start, reported by
crate::OfflineProtocol::local_address, and it is what gets stamped
as Message.sender, what peers see as NeighborDiscovered.peer_id,
and what others use as recipient. An app cannot choose it, because
choosing it would mean claiming a key one does not hold.
Under any configuration that reaches the wire the profile stays local.
The one exception is the explicit
EncryptionConfig::require_encryption = false opt-out, which lets a
plaintext send go out with MLS never initialized — no address has been
derived at that point, so the frame carries the profile as its sender
and the send emits
crate::events::SecurityWarningCode::PlaintextSend. The default
(require_encryption = true) fails such a send closed instead. Treat
the profile as private if that opt-out is in use.
transport: TransportConfigTransport configuration.
dors: DorsConfigDORS (Dynamic Offline Relay Switch) configuration.
relay: RelayConfigRelay management configuration: whether this device carries traffic for other people at all, and the battery floors under which it stops.
mesh_relay: MeshRelayConfigHow this device carries traffic for other people: how far frames travel, how many neighbors each is handed to, and the ceilings that keep forwarding from crowding the radio out.
Whether to forward is Self::relay’s decision; this is the shape of
it once the answer is yes.
path: PathConfigPath selection configuration.
reliability: ReliabilityConfigReliability layer configuration.
encryption: EncryptionConfigEncryption configuration for automatic MLS handling.
initial_ttl: u8Initial TTL (Time-To-Live) for messages.
group: GroupConfigMesh group messaging configuration.
security: SecurityConfigSecurity configuration for transport and control-message hardening.
Implementations§
Source§impl ProtocolConfig
impl ProtocolConfig
Sourcepub fn new(app_id: impl Into<String>, profile: impl Into<String>) -> Self
pub fn new(app_id: impl Into<String>, profile: impl Into<String>) -> Self
Creates a new protocol configuration.
§Arguments
app_id- Application identifierprofile- Local profile selector (storage namespace, never on the wire)
Trait Implementations§
Source§impl Clone for ProtocolConfig
impl Clone for ProtocolConfig
Source§fn clone(&self) -> ProtocolConfig
fn clone(&self) -> ProtocolConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ProtocolConfig
impl RefUnwindSafe for ProtocolConfig
impl Send for ProtocolConfig
impl Sync for ProtocolConfig
impl Unpin for ProtocolConfig
impl UnsafeUnpin for ProtocolConfig
impl UnwindSafe for ProtocolConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more