#[non_exhaustive]pub struct NostrClientTransportConfig {
pub relay_urls: Vec<String>,
pub server_pubkey: String,
pub encryption_mode: EncryptionMode,
pub gift_wrap_mode: GiftWrapMode,
pub is_stateless: bool,
pub timeout: Duration,
pub discovery_relay_urls: Option<Vec<String>>,
pub fallback_operational_relay_urls: Option<Vec<String>>,
pub oversized_transfer: OversizedTransferConfig,
pub open_stream: OpenStreamConfig,
}Expand description
Configuration for the client transport.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.relay_urls: Vec<String>Relay URLs to connect to.
server_pubkey: StringThe server’s public key (hex, npub, or nprofile).
When an nprofile is provided, embedded relay hints are extracted and used during CEP-17 relay resolution.
encryption_mode: EncryptionModeEncryption mode.
gift_wrap_mode: GiftWrapModeGift-wrap policy for encrypted messages.
is_stateless: boolStateless mode: emulate initialize response locally.
timeout: DurationCorrelation-retention TTL for pending client requests (default: 30s).
Stale pending entries older than this are swept from the correlation store. This prevents leaks – rmcp owns actual request timeout and cancellation. Keep this value above your rmcp request timeout to avoid premature cleanup.
discovery_relay_urls: Option<Vec<String>>Relay URLs used for CEP-17 relay-list discovery when operational relays are not configured.
Overrides DEFAULT_BOOTSTRAP_RELAY_URLS when provided.
fallback_operational_relay_urls: Option<Vec<String>>Non-authoritative operational relays probed in parallel with CEP-17 discovery.
oversized_transfer: OversizedTransferConfigCEP-22 oversized payload transfer configuration. Enabled by default.
open_stream: OpenStreamConfigCEP-41 open-stream configuration. Disabled by default (opt-in).
When enabled, drives capability advertisement/learning, the inbound reader
engine, the keepalive sweep, and call_tool_stream. Opt in with
OpenStreamConfig::enabled() / with_enabled(true).
Implementations§
Source§impl NostrClientTransportConfig
impl NostrClientTransportConfig
Sourcepub fn with_server_pubkey(self, pubkey: impl Into<String>) -> Self
pub fn with_server_pubkey(self, pubkey: impl Into<String>) -> Self
Set the server’s public key (hex, npub, or nprofile).
Sourcepub fn with_encryption_mode(self, mode: EncryptionMode) -> Self
pub fn with_encryption_mode(self, mode: EncryptionMode) -> Self
Set the encryption mode.
Sourcepub fn with_gift_wrap_mode(self, mode: GiftWrapMode) -> Self
pub fn with_gift_wrap_mode(self, mode: GiftWrapMode) -> Self
Set the gift-wrap mode (CEP-19).
Sourcepub fn with_stateless(self, stateless: bool) -> Self
pub fn with_stateless(self, stateless: bool) -> Self
Enable or disable stateless mode.
Sourcepub fn with_relay_urls(self, urls: Vec<String>) -> Self
pub fn with_relay_urls(self, urls: Vec<String>) -> Self
Set the relay URLs to connect to.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set the correlation-retention TTL.
Sourcepub fn with_discovery_relay_urls(self, urls: Vec<String>) -> Self
pub fn with_discovery_relay_urls(self, urls: Vec<String>) -> Self
Set relay URLs for CEP-17 relay-list discovery.
Sourcepub fn with_fallback_operational_relay_urls(self, urls: Vec<String>) -> Self
pub fn with_fallback_operational_relay_urls(self, urls: Vec<String>) -> Self
Set fallback operational relay URLs probed in parallel with discovery.
Sourcepub fn with_oversized_transfer(self, config: OversizedTransferConfig) -> Self
pub fn with_oversized_transfer(self, config: OversizedTransferConfig) -> Self
Set the full CEP-22 oversized payload transfer configuration.
Sourcepub fn with_oversized_enabled(self, enabled: bool) -> Self
pub fn with_oversized_enabled(self, enabled: bool) -> Self
Enable or disable CEP-22 oversized payload transfer, leaving other knobs at default.
Sourcepub fn with_open_stream(self, config: OpenStreamConfig) -> Self
pub fn with_open_stream(self, config: OpenStreamConfig) -> Self
Set the full CEP-41 open-stream configuration (disabled by default; opt in
with OpenStreamConfig::enabled()).
Trait Implementations§
Source§impl Clone for NostrClientTransportConfig
impl Clone for NostrClientTransportConfig
Source§fn clone(&self) -> NostrClientTransportConfig
fn clone(&self) -> NostrClientTransportConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NostrClientTransportConfig
impl Debug for NostrClientTransportConfig
Auto Trait Implementations§
impl Freeze for NostrClientTransportConfig
impl RefUnwindSafe for NostrClientTransportConfig
impl Send for NostrClientTransportConfig
impl Sync for NostrClientTransportConfig
impl Unpin for NostrClientTransportConfig
impl UnsafeUnpin for NostrClientTransportConfig
impl UnwindSafe for NostrClientTransportConfig
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> 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