#[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,
}Expand description
Configuration for the client transport.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
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).
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.
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).
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.
Trait Implementations§
Source§impl Clone for NostrClientTransportConfig
impl Clone for NostrClientTransportConfig
Source§fn clone(&self) -> NostrClientTransportConfig
fn clone(&self) -> NostrClientTransportConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more
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>
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 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>
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