Skip to main content

TransportConfig

Struct TransportConfig 

Source
pub struct TransportConfig {
    pub ble_enabled: bool,
    pub wifi_direct_enabled: bool,
    pub internet_enabled: bool,
    pub reticulum_enabled: bool,
    pub nostr_enabled: bool,
    pub nostr_sealing_enabled: bool,
    pub nostr_cold_contact_enabled: bool,
    pub binary_wire_enabled: bool,
}
Expand description

Transport-specific configuration.

Fields§

§ble_enabled: bool

Whether BLE transport is enabled.

§wifi_direct_enabled: bool

Whether Wi-Fi Direct transport is enabled.

§internet_enabled: bool

Whether Internet transport is enabled.

§reticulum_enabled: bool

Whether Reticulum mesh transport is enabled. Defaults to false because Reticulum requires external infrastructure (a running Reticulum daemon or RNode hardware).

§nostr_enabled: bool

Whether Nostr relay transport is enabled. Defaults to false because Nostr requires relay configuration and a secp256k1 keypair.

§nostr_sealing_enabled: bool

Whether outgoing Nostr frames are sealed into NIP-59 gift wraps.

Defaults to true. With it off, the transport publishes the legacy kind-4 event whose content is the whole protocol envelope in cleartext — both usernames, the app id, the metadata map, the content type and a millisecond timestamp, readable by every relay, permanently. Turn it off only to interoperate with a relay that rejects kind 1059 outright.

Send-side only, and never negotiated: inbound gift wraps are always unsealed and inbound legacy frames always parsed, so whatever this is set to, anything a peer sends us stays readable.

It does still affect outbound reachability, in the one direction the receive path cannot cover. A peer on a build that predates sealing subscribes with kinds: [4] only, so it is never handed our kind-1059 events and has no NIP-44 layer to open one with — leaving it on makes such a peer unreachable over Nostr (visibly: no ACK returns, so the send fails through the retry ladder rather than vanishing). That is the second reason to turn this off, alongside a relay that rejects kind 1059.

§nostr_cold_contact_enabled: bool

Whether this install publishes MLS key packages to the relays and resolves peers’ published packages.

Defaults to true, and takes effect only when nostr_enabled is on — which is itself off by default, so nothing is published unless an app deliberately turns Nostr on.

Buys cold first contact: a peer known only by username becomes reachable over Nostr with no prior key-package exchange over some other transport, which is otherwise impossible. It also bounds the sealing downgrade that follows a peer-key eviction, since a forgotten key is re-resolved on the next send instead of waiting for a fresh exchange.

What it costs is worth stating plainly. Publication is the first thing this SDK emits to a relay unprompted: a small set of addressable records sits at this install’s routing tag and is refreshed as slots are consumed, whether or not any message is ever sent. Their content is sealed — a scraper filtering on the kind alone reads nothing, which matters because an MLS key package carries its owner’s username in the leaf credential and cannot be stripped of it — but the existence of a record at a given tag, and the timing of its refreshes, are visible to every relay published to. Turn this off to keep the transport silent until it has traffic, at the price of cold contact.

§binary_wire_enabled: bool

Whether to negotiate and emit the compact binary wire codec.

Defaults to true. It only takes effect between two peers that both advertise support (via their signed key package), so a mixed fleet automatically stays on JSON. Decoding of binary frames is always on, independent of this flag; this gates only advertising and emitting.

Trait Implementations§

Source§

impl Clone for TransportConfig

Source§

fn clone(&self) -> TransportConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TransportConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TransportConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TransportConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for TransportConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Declassify for T

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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