pub struct Options {
pub wait_for_connection: bool,
pub timeout: Duration,
pub send_timeout: Option<Duration>,
pub nip46_timeout: Option<Duration>,
pub shutdown_on_drop: bool,
pub pool: RelayPoolOptions,
/* private fields */
}
Expand description
Options
Fields§
§wait_for_connection: bool
Wait for connection (default: false)
timeout: Duration
Timeout (default: 60)
Used in get_events_of
, req_events_of
and similar as default timeout.
send_timeout: Option<Duration>
Send timeout (default: 20 secs)
nip46_timeout: Option<Duration>
NIP46 timeout (default: 180 secs)
shutdown_on_drop: bool
Shutdown on Client drop
pool: RelayPoolOptions
Pool Options
Implementations§
source§impl Options
impl Options
sourcepub fn wait_for_connection(self, wait: bool) -> Self
pub fn wait_for_connection(self, wait: bool) -> Self
If set to true
, Client
wait that Relay
try at least one time to enstablish a connection before continue.
sourcepub fn wait_for_send(self, wait: bool) -> Self
pub fn wait_for_send(self, wait: bool) -> Self
If set to true
, Client
wait that a message is sent before continue.
sourcepub fn wait_for_subscription(self, wait: bool) -> Self
pub fn wait_for_subscription(self, wait: bool) -> Self
If set to true
, Client
wait that a subscription msg is sent before continue (subscribe
and unsubscribe
methods)
sourcepub fn difficulty(self, difficulty: u8) -> Self
pub fn difficulty(self, difficulty: u8) -> Self
Set default POW diffficulty for Event
sourcepub fn req_filters_chunk_size(self, size: u8) -> Self
pub fn req_filters_chunk_size(self, size: u8) -> Self
Set REQ
filters chunk size
sourcepub fn skip_disconnected_relays(self, skip: bool) -> Self
pub fn skip_disconnected_relays(self, skip: bool) -> Self
Skip disconnected relays during send methods (default: false)
If the relay made just 1 attempt, the relay will not be skipped
sourcepub fn send_timeout(self, timeout: Option<Duration>) -> Self
pub fn send_timeout(self, timeout: Option<Duration>) -> Self
Set default send timeout
sourcepub fn nip46_timeout(self, timeout: Option<Duration>) -> Self
pub fn nip46_timeout(self, timeout: Option<Duration>) -> Self
Set NIP46 timeout
sourcepub fn shutdown_on_drop(self, value: bool) -> Self
pub fn shutdown_on_drop(self, value: bool) -> Self
Shutdown client on drop
sourcepub fn pool(self, opts: RelayPoolOptions) -> Self
pub fn pool(self, opts: RelayPoolOptions) -> Self
Set pool options