#[non_exhaustive]pub struct NostrServerTransportConfig {
pub relay_urls: Vec<String>,
pub encryption_mode: EncryptionMode,
pub gift_wrap_mode: GiftWrapMode,
pub server_info: Option<ServerInfo>,
pub is_announced_server: bool,
pub allowed_public_keys: Vec<String>,
pub excluded_capabilities: Vec<CapabilityExclusion>,
pub max_sessions: usize,
pub cleanup_interval: Duration,
pub session_timeout: Duration,
pub request_timeout: Duration,
}Expand description
Configuration for the server 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.
encryption_mode: EncryptionModeEncryption mode.
gift_wrap_mode: GiftWrapModeGift-wrap kind selection policy (CEP-19).
server_info: Option<ServerInfo>Server information for announcements.
is_announced_server: boolWhether this server publishes public announcements (CEP-6).
allowed_public_keys: Vec<String>Allowed client public keys (hex). Empty = allow all.
excluded_capabilities: Vec<CapabilityExclusion>Capabilities excluded from pubkey whitelisting.
max_sessions: usizeMaximum number of concurrent client sessions (LRU-bounded, default: 1000).
cleanup_interval: DurationSession cleanup interval (default: 60s).
session_timeout: DurationSession timeout (default: 300s).
request_timeout: DurationCorrelation-retention TTL for server-side event routes (default: 60s).
Stale route 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 NostrServerTransportConfig
impl NostrServerTransportConfig
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_server_info(self, info: ServerInfo) -> Self
pub fn with_server_info(self, info: ServerInfo) -> Self
Set server information for announcements.
Sourcepub fn with_announced_server(self, announced: bool) -> Self
pub fn with_announced_server(self, announced: bool) -> Self
Enable or disable public announcement publishing (CEP-6).
Sourcepub fn with_allowed_public_keys(self, keys: Vec<String>) -> Self
pub fn with_allowed_public_keys(self, keys: Vec<String>) -> Self
Set the allowed client public keys (hex). Empty = allow all.
Sourcepub fn with_excluded_capabilities(self, caps: Vec<CapabilityExclusion>) -> Self
pub fn with_excluded_capabilities(self, caps: Vec<CapabilityExclusion>) -> Self
Set capabilities excluded from pubkey whitelisting.
Sourcepub fn with_max_sessions(self, max: usize) -> Self
pub fn with_max_sessions(self, max: usize) -> Self
Set the maximum number of concurrent client sessions.
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_cleanup_interval(self, interval: Duration) -> Self
pub fn with_cleanup_interval(self, interval: Duration) -> Self
Set the session cleanup interval.
Sourcepub fn with_session_timeout(self, timeout: Duration) -> Self
pub fn with_session_timeout(self, timeout: Duration) -> Self
Set the session timeout.
Sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Set the correlation-retention TTL for event routes.
Trait Implementations§
Source§impl Clone for NostrServerTransportConfig
impl Clone for NostrServerTransportConfig
Source§fn clone(&self) -> NostrServerTransportConfig
fn clone(&self) -> NostrServerTransportConfig
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 NostrServerTransportConfig
impl Debug for NostrServerTransportConfig
Auto Trait Implementations§
impl Freeze for NostrServerTransportConfig
impl RefUnwindSafe for NostrServerTransportConfig
impl Send for NostrServerTransportConfig
impl Sync for NostrServerTransportConfig
impl Unpin for NostrServerTransportConfig
impl UnsafeUnpin for NostrServerTransportConfig
impl UnwindSafe for NostrServerTransportConfig
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