pub struct ProtocolConfigBuilder { /* private fields */ }Expand description
Builder for ProtocolConfig with a fluent API.
Implementations§
Source§impl ProtocolConfigBuilder
impl ProtocolConfigBuilder
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 builder.
Sourcepub fn transport(self, config: TransportConfig) -> Self
pub fn transport(self, config: TransportConfig) -> Self
Configures transports.
Sourcepub fn ble_enabled(self, enabled: bool) -> Self
pub fn ble_enabled(self, enabled: bool) -> Self
Enables or disables BLE transport.
Sourcepub fn wifi_direct_enabled(self, enabled: bool) -> Self
pub fn wifi_direct_enabled(self, enabled: bool) -> Self
Enables or disables Wi-Fi Direct transport.
Sourcepub fn internet_enabled(self, enabled: bool) -> Self
pub fn internet_enabled(self, enabled: bool) -> Self
Enables or disables Internet transport.
Sourcepub fn nostr_enabled(self, enabled: bool) -> Self
pub fn nostr_enabled(self, enabled: bool) -> Self
Enables or disables Nostr relay transport.
Sourcepub fn nostr_sealing_enabled(self, enabled: bool) -> Self
pub fn nostr_sealing_enabled(self, enabled: bool) -> Self
Enables or disables sealing of outgoing Nostr frames (default on).
Sourcepub fn nostr_cold_contact_enabled(self, enabled: bool) -> Self
pub fn nostr_cold_contact_enabled(self, enabled: bool) -> Self
Enables or disables Nostr key-package publication and peer resolution
(default on; see TransportConfig::nostr_cold_contact_enabled).
Sourcepub fn dors(self, config: DorsConfig) -> Self
pub fn dors(self, config: DorsConfig) -> Self
Configures DORS (Dynamic Offline Relay Switch).
Sourcepub fn online_first(self, enabled: bool) -> Self
pub fn online_first(self, enabled: bool) -> Self
Enables online-first mode (prefer Internet when available).
Sourcepub fn relay(self, config: RelayConfig) -> Self
pub fn relay(self, config: RelayConfig) -> Self
Configures relay management.
Sourcepub fn mesh_relay(self, config: MeshRelayConfig) -> Self
pub fn mesh_relay(self, config: MeshRelayConfig) -> Self
Configures how traffic is carried for other people.
Sourcepub fn path(self, config: PathConfig) -> Self
pub fn path(self, config: PathConfig) -> Self
Configures path selection.
Sourcepub fn reliability(self, config: ReliabilityConfig) -> Self
pub fn reliability(self, config: ReliabilityConfig) -> Self
Configures reliability layer.
Sourcepub fn initial_ttl(self, ttl: u8) -> Self
pub fn initial_ttl(self, ttl: u8) -> Self
Sets the initial TTL for messages.
Sourcepub fn encryption(self, config: EncryptionConfig) -> Self
pub fn encryption(self, config: EncryptionConfig) -> Self
Configures encryption settings.
Sourcepub fn encryption_enabled(self, enabled: bool) -> Self
pub fn encryption_enabled(self, enabled: bool) -> Self
Enables or disables automatic encryption.
Sourcepub fn auto_key_exchange(self, enabled: bool) -> Self
pub fn auto_key_exchange(self, enabled: bool) -> Self
Enables or disables automatic key exchange on peer discovery.
Sourcepub fn store_pending_messages(self, enabled: bool) -> Self
pub fn store_pending_messages(self, enabled: bool) -> Self
Enables or disables storing pending messages for later encryption.
Sourcepub fn require_encryption(self, required: bool) -> Self
pub fn require_encryption(self, required: bool) -> Self
Enables or disables strict encryption requirement.
Sourcepub fn pending_queue(self, config: PendingQueueConfig) -> Self
pub fn pending_queue(self, config: PendingQueueConfig) -> Self
Configures pending encrypted message queue bounds and overflow behavior.
Sourcepub fn group(self, config: GroupConfig) -> Self
pub fn group(self, config: GroupConfig) -> Self
Configures group messaging settings.
Sourcepub fn max_group_members(self, max: usize) -> Self
pub fn max_group_members(self, max: usize) -> Self
Sets the maximum number of members allowed in a single group.
Sourcepub fn group_relay_enabled(self, enabled: bool) -> Self
pub fn group_relay_enabled(self, enabled: bool) -> Self
Sets whether groups should attempt relay server registration.
Sourcepub fn group_relay_broadcast_enabled(self, enabled: bool) -> Self
pub fn group_relay_broadcast_enabled(self, enabled: bool) -> Self
Sets whether relay-synced groups may send via a single relay broadcast
instead of per-member fan-out. See
GroupConfig::relay_broadcast_enabled — on by default, but only
ever taken against a relay that advertised the group_delivery_v3
capability, whose settled, address-space delivery report gives the
broadcast a per-recipient delivery contract.
Sourcepub fn group_enforce_admin_commits(self, enabled: bool) -> Self
pub fn group_enforce_admin_commits(self, enabled: bool) -> Self
Sets whether unauthorized MLS membership commits are refused rather
than applied-and-reported. See
GroupConfig::enforce_admin_commits — off by default, and enabling
it risks permanently forking members whose admin overlay disagrees.
Sourcepub fn security(self, config: SecurityConfig) -> Self
pub fn security(self, config: SecurityConfig) -> Self
Configures security settings.
Sourcepub fn require_transport_identity(self, required: bool) -> Self
pub fn require_transport_identity(self, required: bool) -> Self
Sets whether transport identity is required for control messages.
Sourcepub fn build(self) -> Result<ProtocolConfig>
pub fn build(self) -> Result<ProtocolConfig>
Builds and validates the configuration.
§Returns
Returns Ok(ProtocolConfig) if valid, Err otherwise.
Auto Trait Implementations§
impl Freeze for ProtocolConfigBuilder
impl RefUnwindSafe for ProtocolConfigBuilder
impl Send for ProtocolConfigBuilder
impl Sync for ProtocolConfigBuilder
impl Unpin for ProtocolConfigBuilder
impl UnsafeUnpin for ProtocolConfigBuilder
impl UnwindSafe for ProtocolConfigBuilder
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> 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