Skip to main content

ProtocolConfigBuilder

Struct ProtocolConfigBuilder 

Source
pub struct ProtocolConfigBuilder { /* private fields */ }
Expand description

Builder for ProtocolConfig with a fluent API.

Implementations§

Source§

impl ProtocolConfigBuilder

Source

pub fn new(app_id: impl Into<String>, profile: impl Into<String>) -> Self

Creates a new builder.

Source

pub fn transport(self, config: TransportConfig) -> Self

Configures transports.

Source

pub fn ble_enabled(self, enabled: bool) -> Self

Enables or disables BLE transport.

Source

pub fn wifi_direct_enabled(self, enabled: bool) -> Self

Enables or disables Wi-Fi Direct transport.

Source

pub fn internet_enabled(self, enabled: bool) -> Self

Enables or disables Internet transport.

Source

pub fn nostr_enabled(self, enabled: bool) -> Self

Enables or disables Nostr relay transport.

Source

pub fn nostr_sealing_enabled(self, enabled: bool) -> Self

Enables or disables sealing of outgoing Nostr frames (default on).

Source

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).

Source

pub fn dors(self, config: DorsConfig) -> Self

Configures DORS (Dynamic Offline Relay Switch).

Source

pub fn online_first(self, enabled: bool) -> Self

Enables online-first mode (prefer Internet when available).

Source

pub fn relay(self, config: RelayConfig) -> Self

Configures relay management.

Source

pub fn mesh_relay(self, config: MeshRelayConfig) -> Self

Configures how traffic is carried for other people.

Source

pub fn path(self, config: PathConfig) -> Self

Configures path selection.

Source

pub fn reliability(self, config: ReliabilityConfig) -> Self

Configures reliability layer.

Source

pub fn initial_ttl(self, ttl: u8) -> Self

Sets the initial TTL for messages.

Source

pub fn encryption(self, config: EncryptionConfig) -> Self

Configures encryption settings.

Source

pub fn encryption_enabled(self, enabled: bool) -> Self

Enables or disables automatic encryption.

Source

pub fn auto_key_exchange(self, enabled: bool) -> Self

Enables or disables automatic key exchange on peer discovery.

Source

pub fn store_pending_messages(self, enabled: bool) -> Self

Enables or disables storing pending messages for later encryption.

Source

pub fn require_encryption(self, required: bool) -> Self

Enables or disables strict encryption requirement.

Source

pub fn pending_queue(self, config: PendingQueueConfig) -> Self

Configures pending encrypted message queue bounds and overflow behavior.

Source

pub fn group(self, config: GroupConfig) -> Self

Configures group messaging settings.

Source

pub fn max_group_members(self, max: usize) -> Self

Sets the maximum number of members allowed in a single group.

Source

pub fn group_relay_enabled(self, enabled: bool) -> Self

Sets whether groups should attempt relay server registration.

Source

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.

Source

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.

Source

pub fn security(self, config: SecurityConfig) -> Self

Configures security settings.

Source

pub fn require_transport_identity(self, required: bool) -> Self

Sets whether transport identity is required for control messages.

Source

pub fn build(self) -> Result<ProtocolConfig>

Builds and validates the configuration.

§Returns

Returns Ok(ProtocolConfig) if valid, Err otherwise.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Classify for T

Source§

type Classified = T

Source§

fn classify(self) -> T

Source§

impl<T> Declassify for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more