### Nostr SDK Getting Started Example Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/index.html Demonstrates generating keys, configuring a client with custom options including proxy settings, adding relays, setting metadata, and publishing text notes. Requires `tokio` for async operations. ```rust use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; use nostr_sdk::prelude::*; #[tokio::main] async fn main() -> Result<()> { // Generate new random keys let keys = Keys::generate(); // Or use your already existing (from hex or bech32) let keys = Keys::parse("hex-or-bech32-secret-key")?; // Show bech32 public key let bech32_pubkey: String = keys.public_key().to_bech32()?; println!("Bech32 PubKey: {}", bech32_pubkey); // Configure client to use proxy for `.onion` relays let addr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::LOCALHOST, 9050)); let connection: Connection = Connection::new() .proxy(addr) // Use `.embedded_tor()` instead to enable the embedded tor client (require `tor` feature) .target(ConnectionTarget::Onion); let opts = ClientOptions::new().connection(connection); // Create new client with custom options let client = Client::builder().signer(keys.clone()).opts(opts).build(); // Add relays client.add_relay("wss://relay.damus.io").await?; client.add_relay("ws://jgqaglhautb4k6e6i2g34jakxiemqp6z4wynlirltuukgkft2xuglmqd.onion").await?; // Add read relay client.add_read_relay("wss://relay.nostr.info").await?; // Connect to relays client.connect().await; let metadata = Metadata::new() .name("username") .display_name("My Username") .about("Description") .picture(Url::parse("https://example.com/avatar.png")?) .banner(Url::parse("https://example.com/banner.png")?) .nip05("username@example.com") .lud16("pay@yukikishimoto.com") .custom_field("custom_field", "my value"); // Update metadata client.set_metadata(&metadata).await?; // Publish a text note let builder = EventBuilder::text_note("My first text note from rust-nostr!"); client.send_event_builder(builder).await?; // Create a POW text note let builder = EventBuilder::text_note("POW text note from nostr-sdk").pow(20); client.send_event_builder(builder).await?; // client.send_event_builder_to(["wss://relay.damus.io"], builder).await?; Ok(()) } ``` -------------------------------- ### Example: ClientBuilder with Signer Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Demonstrates how to create a client using a private key as the signer. ```rust use nostr_sdk::prelude::*; // Signer with private keys let keys = Keys::generate(); let client = ClientBuilder::new().signer(keys).build(); ``` -------------------------------- ### ClientOptions::autoconnect Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Configures whether to automatically start a connection with relays. ```APIDOC ## ClientOptions::autoconnect ### Description Automatically start connection with relays (default: false). When set to `true`, there isn’t the need of calling the connect methods. ### Method ```rust pub fn autoconnect(self, val: bool) -> Self ``` ``` -------------------------------- ### Get Default Client Options Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Returns the default ClientOptions value. ```rust fn default() -> ClientOptions ``` -------------------------------- ### WASM Compilation for Nostr SDK Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/index.html Instructions for compiling the nostr-sdk crate for WASM targets on macOS, including necessary environment variables and package installations. ```bash brew install llvm LLVM_PATH=$(brew --prefix llvm) AR="${LLVM_PATH}/bin/llvm-ar" CC="${LLVM_PATH}/bin/clang" cargo build --target wasm32-unknown-unknown ``` -------------------------------- ### Get Any Reference for ClientBuilder Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Provides an immutable reference to the `ClientBuilder` as a `dyn Any` trait object. ```rust fn as_any(&self) -> &(dyn Any + 'static) ``` -------------------------------- ### Get Mutable Any Reference for ClientBuilder Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Provides a mutable reference to the `ClientBuilder` as a `dyn Any` trait object. ```rust fn as_any_mut(&mut self) -> &mut (dyn Any + 'static) ``` -------------------------------- ### Get Relay Monitor Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Retrieve an optional reference to the relay monitor. The monitor provides insights into the status and performance of connected relays. ```rust pub fn monitor(&self) -> Option<&Monitor> ``` -------------------------------- ### Get All Relays Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Retrieve a HashMap of all connected relays, including their `RelayUrl` and `Relay` objects. Use `RelayPool::all_relays` for all relays or `RelayPool::relays_with_flag` for specific flags. ```rust pub async fn relays(&self) -> HashMap ``` -------------------------------- ### Get Notification Listener Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Obtain a `Receiver` for `RelayPoolNotification`. This allows you to listen for notifications from the relay pool starting from the moment this method is called. ```rust pub fn notifications(&self) -> Receiver ``` -------------------------------- ### Build Client Instance Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Finalizes the configuration and constructs the `Client` instance. ```rust pub fn build(self) -> Client ``` -------------------------------- ### Create New Client Options Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Creates a new instance of ClientOptions with default settings. ```rust pub fn new() -> Self ``` -------------------------------- ### Client Type Identity Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Provides methods to get the `TypeId` of the client. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters None ### Response - **TypeId**: The unique identifier for the type of `self`. ``` -------------------------------- ### Compose and Subscribe to Filters Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Demonstrates how to compose a filter for subscriptions and then subscribe to it. Also shows how to create an auto-closing subscription with an exit policy. ```rust // Compose filter let subscription = Filter::new() .pubkeys(vec![keys.public_key()]) .since(Timestamp::now()); // Subscribe let output = client.subscribe(subscription, None).await?; println!("Subscription ID: {}", output.val); // Auto-closing subscription let id = SubscriptionId::generate(); let subscription = Filter::new().kind(Kind::TextNote).limit(10); let opts = SubscribeAutoCloseOptions::default().exit_policy(ReqExitPolicy::ExitOnEOSE); let output = client.subscribe(subscription, Some(opts)).await?; println!("Subscription ID: {} [auto-closing]", output.val); ``` -------------------------------- ### ClientOptions::new Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Creates new default client options. ```APIDOC ## ClientOptions::new ### Description Creates new default options. ### Method ```rust pub fn new() -> Self ``` ``` -------------------------------- ### ClientBuilder::new Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Creates a new default ClientBuilder instance. ```APIDOC ## ClientBuilder::new ### Description Creates a new default client builder. ### Method `new()` ### Returns - `Self`: A new instance of `ClientBuilder`. ``` -------------------------------- ### Connection::new Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Creates a new default connection configuration. ```APIDOC ## Connection::new ### Description Creates a new default connection configuration. ### Returns - `Self`: A new `Connection` instance with default settings. ``` -------------------------------- ### Build Client with Options Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Construct a client using a builder pattern, allowing for custom options and signer configuration. This is useful for setting up relays with specific configurations like gossip enabled. ```rust use std::time::Duration; use nostr_sdk::prelude::*; let signer = Keys::generate(); let opts = ClientOptions::default().gossip(true); let client: Client = Client::builder().signer(signer).opts(opts).build(); ``` -------------------------------- ### Get Type ID for ClientBuilder Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Returns the `TypeId` of the `ClientBuilder` struct, used for runtime type identification. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### Initialize Client with Signer Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Construct a new Nostr client instance using a provided signer. Use `Client::default()` if no signer is needed. ```rust use nostr_sdk::prelude::*; let keys = Keys::generate(); let client = Client::new(keys); ``` -------------------------------- ### Get RelayPool Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Retrieve a reference to the `RelayPool` managed by the client. The `RelayPool` handles all connections and communication with Nostr relays. ```rust pub fn pool(&self) -> &RelayPool ``` -------------------------------- ### ClientBuilder::opts Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Sets the client options for the client builder. ```APIDOC ## ClientBuilder::opts ### Description Sets the client options for the client builder. ### Method `opts(self, opts: ClientOptions) -> Self` ### Parameters - **opts** (ClientOptions): The client options to set. ### Returns - `Self`: The modified `ClientBuilder` instance. ``` -------------------------------- ### fetch_combined_events Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Get events both from the database and relays. This is an auto-closing subscription that closes on EOSE. For long-lived subscriptions, use `Client::subscribe`. ```APIDOC ## pub async fn fetch_combined_events(&self, filter: Filter, timeout: Duration) -> Result ### Description Get events both from database and relays. This is an **auto-closing subscription** and will be closed automatically on `EOSE`. For long-lived subscriptions, check `Client::subscribe`. ### Parameters #### Path Parameters - **filter** (Filter) - Required - The filter criteria for events. - **timeout** (Duration) - Required - The timeout duration for fetching events. ``` -------------------------------- ### Client::new Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Constructs a new Nostr client with a provided signer. Use `Client::default()` if no signer is needed initially. ```APIDOC ## Client::new ### Description Construct client with signer. To construct a client without signer use `Client::default`. ### Signature ```rust pub fn new(signer: T) -> Self where T: IntoNostrSigner ``` ### Example ```rust use nostr_sdk::prelude::* let keys = Keys::generate(); let client = Client::new(keys); ``` ``` -------------------------------- ### Get Specific Relay Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Retrieve a specific `Relay` object by its URL. Returns an error if the relay has not been added or is not currently connected. ```rust pub async fn relay(&self, url: U) -> Result where U: TryIntoUrl, Error: From<::Err>, ``` -------------------------------- ### Get NostrDatabase Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Retrieve a reference to the `NostrDatabase` used by the client for storing and retrieving events. This is typically an `Arc`. ```rust pub fn database(&self) -> &Arc ``` -------------------------------- ### Default ClientBuilder Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Provides a default `ClientBuilder` instance, equivalent to calling `ClientBuilder::new()`. ```rust fn default() -> Self ``` -------------------------------- ### Clone From Client Options Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Performs copy-assignment from a source ClientOptions value. ```rust fn clone_from(&mut self, source: &Self) ``` -------------------------------- ### Client::builder Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Provides a builder pattern for creating a `Client` instance with custom options. ```APIDOC ## Client::builder ### Description Construct client. ### Signature ```rust pub fn builder() -> ClientBuilder ``` ### Example ```rust use std::time::Duration; use nostr_sdk::prelude::*; let signer = Keys::generate(); let opts = ClientOptions::default().gossip(true); let client: Client = Client::builder().signer(signer).opts(opts).build(); ``` ``` -------------------------------- ### Error Trait Implementation: cause (Deprecated) Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/enum.Error.html Provides a deprecated method for getting the cause of an error. The `source` method is preferred as it supports downcasting. ```rust fn cause(&self) -> Option<&dyn Error> ``` -------------------------------- ### Set Connection Mode Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Configures the connection mode. The default mode is 'direct'. ```rust pub fn mode(self, mode: ConnectionMode) -> Self ``` -------------------------------- ### connect Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Initiates connections to all added relays that are in an Initialized or Terminated state. Background tasks are spawned for each connection attempt. ```APIDOC ## connect ### Description Connect to all added relays. Attempts to initiate a connection for every relay currently in `RelayStatus::Initialized` or `RelayStatus::Terminated`. A background connection task is spawned for each such relay, which then tries to establish the connection. Any relay not in one of these two statuses is skipped. For further details, see the documentation of `Relay::connect`. ### Method `pub async fn connect(&self)` ### Returns - `()`: This method does not return a value. ``` -------------------------------- ### ClientOptions Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/index.html Provides options for configuring the Nostr client. ```APIDOC ## Struct: ClientOptions ### Description This struct holds various options for configuring the Nostr client. ### Fields - **settings**: Options - Client settings. - **connection_non_wasm**: ConnectionNon-WebAssembly - Connection configuration for non-WebAssembly environments. ### Type Aliases - **Options**: Deprecated alias for settings. ``` -------------------------------- ### Error Trait Implementation: description (Deprecated) Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/enum.Error.html Provides a deprecated method for getting a string description of the error. Prefer using the `Display` implementation or `to_string()` instead. ```rust fn description(&self) -> &str ``` -------------------------------- ### Query Database and Relays, then Merge Events Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html This method is a temporary solution for querying events from both a local database and relays and merging the results. For optimal performance and resource usage, consider using `Client::sync`, `Client::subscribe`, `NostrDatabase::query`, and `Client::handle_notifications`. ```rust // Query database let stored_events: Events = client.database().query(filter.clone()).await?; // Query relays let fetched_events: Events = client.fetch_events(filter, Duration::from_secs(10)).await?; // Merge result let events: Events = stored_events.merge(fetched_events); // Iter and print result for event in events.into_iter() { println!("{}", event.as_json()); } ``` -------------------------------- ### ClientBuilder::build Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Builds the Nostr client from the configured ClientBuilder. ```APIDOC ## ClientBuilder::build ### Description Builds the `Client` from the configured `ClientBuilder`. ### Method `build(self) -> Client` ### Returns - `Client`: The constructed Nostr client instance. ``` -------------------------------- ### Connection::direct Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Configures the connection to be direct. ```APIDOC ## Connection::direct ### Description Sets the connection to be direct. ### Returns - `Self`: The modified `Connection` instance. ``` -------------------------------- ### ClientBuilder::database Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Sets the database for the client builder. ```APIDOC ## ClientBuilder::database ### Description Sets the database for the client builder. ### Method `database(self, database: D) -> Self` where D: IntoNostrDatabase ### Parameters - **database** (D): The database to set. Must implement `IntoNostrDatabase`. ### Returns - `Self`: The modified `ClientBuilder` instance. ``` -------------------------------- ### ClientBuilder::monitor Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Sets the monitor for the client builder. ```APIDOC ## ClientBuilder::monitor ### Description Sets the monitor for the client builder. ### Method `monitor(self, monitor: Monitor) -> Self` ### Parameters - **monitor** (Monitor): The monitor to set. ### Returns - `Self`: The modified `ClientBuilder` instance. ``` -------------------------------- ### Set Client Options Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Applies custom `ClientOptions` to configure the client's behavior, such as connection timeouts or message limits. ```rust pub fn opts(self, opts: ClientOptions) -> Self ``` -------------------------------- ### Clone Client Options Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Returns a duplicate of the ClientOptions value. ```rust fn clone(&self) -> ClientOptions ``` -------------------------------- ### try_connect Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Attempts to establish connections with relays without spawning background tasks if the initial attempt fails. Use `Client::connect` for automatic retries. ```APIDOC ## try_connect ### Description Try to establish a connection with the relays. Attempts to establish a connection for every relay currently in `RelayStatus::Initialized` or `RelayStatus::Terminated` without spawning the connection task if it fails. This means that if the connection fails, no automatic retries are scheduled. Use `Client::connect` if you want to immediately spawn a connection task, regardless of whether the initial connection succeeds. For further details, see the documentation of `Relay::try_connect`. ### Method `pub async fn try_connect(&self, timeout: Duration) -> Output<()>` ### Parameters #### Path Parameters - **timeout** (Duration): The maximum duration to wait for the connection attempt. ``` -------------------------------- ### Set Connection Target Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Specifies the connection target. The default target is 'all'. ```rust pub fn target(self, target: ConnectionTarget) -> Self ``` -------------------------------- ### Same Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Defines an associated type `Output` which should always be `Self`. ```APIDOC ## Same Associated Type ### Description Should always be `Self`. ### Type Alias `type Output = T` ``` -------------------------------- ### Type Conversion: TryFrom and TryInto Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/enum.Error.html Enables fallible type conversions, returning a `Result`. ```APIDOC ## fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion. ### Method `try_from` ``` ```APIDOC ## fn try_into(self) -> Result>::Error> ### Description Performs the conversion. ### Method `try_into` ``` -------------------------------- ### Format Client Options for Debugging Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Formats the ClientOptions value for debugging purposes. ```rust fn fmt(&self, f: &mut Formatter<'_>) -> Result ``` -------------------------------- ### Type Conversion: Into Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/enum.Error.html Facilitates conversion from one type to another using the `From` trait. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ``` ```APIDOC ## fn into(self) -> U ### Description Calls `U::from(self)`. This conversion is whatever the implementation of `From for U` chooses to do. ### Method `into` ``` -------------------------------- ### Configure Relay Pool Options Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Sets the options for the relay pool. ```rust pub fn pool(self, opts: RelayPoolOptions) -> Self ``` -------------------------------- ### DynClone Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Provides a `__clone_box` method for dynamic cloning. ```APIDOC ## __clone_box ### Description Internal method for dynamic cloning. ### Method `__clone_box(&self, _: Private) -> *mut ()` ``` -------------------------------- ### send_event_builder_to Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Takes an EventBuilder, signs it using NostrSigner, and broadcasts it to specific relays. Requires a NostrSigner. ```APIDOC ## send_event_builder_to ### Description Take an `EventBuilder`, sign it by using the `NostrSigner` and broadcast to specific relays. This method requires a `NostrSigner`. Check `Client::send_event_to` from more details. ### Method `async fn send_event_builder_to(&self, urls: I, builder: EventBuilder) -> Result, Error>` where I: IntoIterator, U: TryIntoUrl, Error: From<::Err> ``` -------------------------------- ### into_any_sync Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Converts a Box to Box for downcasting. ```APIDOC ## into_any_sync ### Description Converts `Box` (where `Trait: DowncastSync`) to `Box`, which can then be `downcast` into `Box` where `ConcreteType` implements `Trait`. ### Method `into_any_sync(self: Box) -> Box` ``` -------------------------------- ### sync_with Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Sync events with specific relays using negentropy reconciliation. ```APIDOC ## pub async fn sync_with(&self, urls: I, filter: Filter, opts: &SyncOptions) -> Result, Error> ### Description Sync events with specific relays (negentropy reconciliation). https://github.com/hoytech/negentropy ### Parameters #### Path Parameters - **urls** (I) - Required - An iterator of URLs for the relays. - **filter** (Filter) - Required - The filter criteria for events. - **opts** (SyncOptions) - Required - Synchronization options. ``` -------------------------------- ### Set Database Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Configures the database backend for storing events. Accepts types that can be converted into a NostrDatabase. ```rust pub fn database(self, database: D) -> Self where D: IntoNostrDatabase, ``` -------------------------------- ### ClientBuilder::admit_policy Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Sets an admission policy for the client builder. ```APIDOC ## ClientBuilder::admit_policy ### Description Sets an admission policy for the client builder. ### Method `admit_policy(self, policy: T) -> Self` where T: AdmitPolicy + 'static ### Parameters - **policy** (T): The admission policy to set. Must implement `AdmitPolicy` and be `'static`. ### Returns - `Self`: The modified `ClientBuilder` instance. ``` -------------------------------- ### DynClone Implementation Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html An implementation for dynamic cloning of trait objects. ```APIDOC ### impl DynClone for T where T: Clone, ### fn __clone_box(&self, _: Private) -> *mut () ``` -------------------------------- ### Client::monitor Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Returns an optional reference to the relay monitor. ```APIDOC ## Client::monitor ### Description Get the relay monitor. ### Signature ```rust pub fn monitor(&self) -> Option<&Monitor> ``` ``` -------------------------------- ### Client Cloning Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Provides methods for cloning client data. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) ### Description 🔬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. ### Method `clone_to_uninit` ### Parameters - **dest** (*mut u8): A mutable pointer to the destination memory location. ### Response None ``` ```APIDOC ## fn to_owned(&self) -> T ### Description Creates owned data from borrowed data, usually by cloning. ### Method `to_owned` ### Parameters None ### Response - **T**: An owned version of the data. ``` ```APIDOC ## fn clone_into(&self, target: &mut T) ### Description Uses borrowed data to replace owned data, usually by cloning. ### Method `clone_into` ### Parameters - **target** (&mut T): A mutable reference to the owned data to be replaced. ### Response None ``` -------------------------------- ### Connection::target Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Sets the connection target for the client. ```APIDOC ## Connection::target ### Description Sets the connection target for the client. ### Parameters - `target` (ConnectionTarget): The desired connection target. ### Returns - `Self`: The modified `Connection` instance. ``` -------------------------------- ### Configure Minimum Proof of Work Difficulty Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Sets the minimum Proof of Work difficulty for received events. This is deprecated and users should use AdmitPolicy instead. ```rust pub fn min_pow(self, _difficulty: u8) -> Self ``` -------------------------------- ### Configure Subscription Verification Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Enables verification that received events belong to a subscription and match its filter. ```rust pub fn verify_subscriptions(self, enable: bool) -> Self ``` -------------------------------- ### ConnectionNon-WebAssembly Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/index.html Configuration for establishing a connection in non-WebAssembly environments. ```APIDOC ## Struct: ConnectionNon-WebAssembly ### Description Defines connection parameters specific to non-WebAssembly environments. ### Fields - **connection**: ConnectionTargetNon-WebAssembly - The target for the connection. ``` -------------------------------- ### ClientOptions::connection Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Sets the connection mode and target for relays. Available on non-WebAssembly only. ```APIDOC ## ClientOptions::connection ### Description Connection mode and target. Available on **non-WebAssembly** only. ### Method ```rust pub fn connection(self, connection: Connection) -> Self ``` ``` -------------------------------- ### Client Instrumentation Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Methods for instrumenting the client with spans. ```APIDOC ## fn instrument(self, span: Span) -> Instrumented ### Description Instruments this type with the provided `Span`, returning an `Instrumented` wrapper. ### Method `instrument` ### Parameters - **span** (Span): The span to instrument with. ### Response - **Instrumented**: A wrapper type that includes the span. ``` ```APIDOC ## fn in_current_span(self) -> Instrumented ### Description Instruments this type with the current `Span`, returning an `Instrumented` wrapper. ### Method `in_current_span` ### Parameters None ### Response - **Instrumented**: A wrapper type that includes the current span. ``` -------------------------------- ### send_event_builder Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Takes an EventBuilder, signs it using NostrSigner, and broadcasts it to relays. Requires a NostrSigner. ```APIDOC ## send_event_builder ### Description Take an `EventBuilder`, sign it by using the `NostrSigner` and broadcast to relays. This method requires a `NostrSigner`. Check `Client::send_event` from more details. ### Method `async fn send_event_builder(&self, builder: EventBuilder) -> Result, Error>` ``` -------------------------------- ### TryInto Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Provides a `try_into` method for fallible type conversions. ```APIDOC ## try_into ### Description Performs the conversion. ### Method `try_into(self) -> Result>::Error>` ### Associated Types * `Error`: The type returned in the event of a conversion error. ``` -------------------------------- ### Connection::mode Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Sets the connection mode for the client. ```APIDOC ## Connection::mode ### Description Sets the connection mode for the client. ### Parameters - `mode` (ConnectionMode): The desired connection mode. ### Returns - `Self`: The modified `Connection` instance. ``` -------------------------------- ### Set Direct Connection Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Configures the connection to be direct, bypassing any proxy settings. ```rust pub fn direct(self) -> Self ``` -------------------------------- ### Clone ClientBuilder Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Creates a duplicate of the current `ClientBuilder` state. Useful for creating multiple clients with similar configurations. ```rust fn clone(&self) -> ClientBuilder ``` -------------------------------- ### Client Either Conversion Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Methods for converting the client into an `Either` type. ```APIDOC ## fn into_either(self, into_left: bool) -> Either ### Description Converts `self` into a `Left` variant of `Either` if `into_left` is `true`. Converts `self` into a `Right` variant of `Either` otherwise. ### Method `into_either` ### Parameters - **into_left** (bool): If `true`, converts to `Left`; otherwise, converts to `Right`. ### Response - **Either**: An `Either` enum containing `Self`. ``` ```APIDOC ## fn into_either_with(self, into_left: F) -> Either ### Description Converts `self` into a `Left` variant of `Either` if `into_left(&self)` returns `true`. Converts `self` into a `Right` variant of `Either` otherwise. ### Method `into_either_with` ### Parameters - **into_left** (F): A closure that takes a reference to `self` and returns a boolean indicating whether to convert to `Left`. ### Response - **Either**: An `Either` enum containing `Self`. ``` -------------------------------- ### Into Trait Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.ClientOptions.html Provides a conversion from a type to another type that can be created from it. ```APIDOC ## fn into(self) -> U ### Description Calls `U::from(self)`. That is, this conversion is whatever the implementation of `From for U` chooses to do. ### Method `into` ``` -------------------------------- ### Connection Struct Definition Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Defines the structure for connection configuration, including mode and target. Available on non-WebAssembly targets only. ```rust pub struct Connection { pub mode: ConnectionMode, pub target: ConnectionTarget, } ``` -------------------------------- ### Connection::proxy Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Configures the connection to use a proxy. ```APIDOC ## Connection::proxy ### Description Configures the connection to use a proxy. ### Parameters - `addr` (SocketAddr): The address of the proxy server. ### Returns - `Self`: The modified `Connection` instance. ``` -------------------------------- ### Sign Event Builder Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Builds and signs an event using an `EventBuilder`. This method requires a `NostrSigner`. ```rust client.sign_event_builder(builder).await? ``` -------------------------------- ### Into Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Provides an `into` method for type conversion via `From` trait. ```APIDOC ## into ### Description Calls `U::from(self)`. This conversion is determined by the implementation of `From for U`. ### Method `into(self) -> U` ``` -------------------------------- ### Subscriber Integration Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/enum.Error.html Attaches subscribers for event dispatching. ```APIDOC ## fn with_subscriber(self, subscriber: S) -> WithDispatch ### Description Attaches the provided `Subscriber` to this type, returning a `WithDispatch` wrapper. ### Method `with_subscriber` ``` ```APIDOC ## fn with_current_subscriber(self) -> WithDispatch ### Description Attaches the current default `Subscriber` to this type, returning a `WithDispatch` wrapper. ### Method `with_current_subscriber` ``` -------------------------------- ### Configure Connection Mode Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Sets the connection mode and target for relays. This is only available on non-WebAssembly targets. ```rust pub fn connection(self, connection: Connection) -> Self ``` -------------------------------- ### Client Type Conversion Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Methods for converting client types. ```APIDOC ## fn into_any(self: Box) -> Box ### Description Converts `Box` (where `Trait: Downcast`) to `Box`, which can then be `downcast` into `Box` where `ConcreteType` implements `Trait`. ### Method `into_any` ### Parameters None ### Response - **Box**: A boxed trait object implementing `Any`. ``` ```APIDOC ## fn into_any_rc(self: Rc) -> Rc ### Description Converts `Rc` (where `Trait: Downcast`) to `Rc`, which can then be further `downcast` into `Rc` where `ConcreteType` implements `Trait`. ### Method `into_any_rc` ### Parameters None ### Response - **Rc**: An `Rc` holding a trait object implementing `Any`. ``` ```APIDOC ## fn as_any(&self) -> &(dyn Any + 'static) ### Description Converts `&Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&Any`’s vtable from `&Trait`’s. ### Method `as_any` ### Parameters None ### Response - **&(dyn Any + 'static)**: A reference to a trait object implementing `Any`. ``` ```APIDOC ## fn as_any_mut(&mut self) -> &mut (dyn Any + 'static) ### Description Converts `&mut Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&mut Any`’s vtable from `&mut Trait`’s. ### Method `as_any_mut` ### Parameters None ### Response - **&mut (dyn Any + 'static)**: A mutable reference to a trait object implementing `Any`. ``` ```APIDOC ## fn into_any_send(self: Box) -> Box ### Description Converts `Box` (where `Trait: DowncastSend`) to `Box`, which can then be `downcast` into `Box` where `ConcreteType` implements `Trait`. ### Method `into_any_send` ### Parameters None ### Response - **Box**: A boxed trait object implementing `Any` and `Send`. ``` ```APIDOC ## fn into_any_sync(self: Box) -> Box ### Description Converts `Box` (where `Trait: DowncastSync`) to `Box`, which can then be `downcast` into `Box` where `ConcreteType` implements `Trait`. ### Method `into_any_sync` ### Parameters None ### Response - **Box**: A boxed trait object implementing `Any`, `Send`, and `Sync`. ``` ```APIDOC ## fn into_any_arc(self: Arc) -> Arc ### Description Converts `Arc` (where `Trait: DowncastSync`) to `Arc`, which can then be `downcast` into `Arc` where `ConcreteType` implements `Trait`. ### Method `into_any_arc` ### Parameters None ### Response - **Arc**: An `Arc` holding a trait object implementing `Any`, `Send`, and `Sync`. ``` ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ### Parameters - **t** (T): The value to convert. ### Response - **T**: The unchanged value. ``` ```APIDOC ## fn into(self) -> U ### Description Calls `U::from(self)`. That is, this conversion is whatever the implementation of `From for U` chooses to do. ### Method `into` ### Parameters None ### Response - **U**: The converted value. ``` ```APIDOC ## fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion. ### Method `try_from` ### Parameters - **value** (U): The value to convert. ### Response - **Result**: A `Result` containing the converted value or an error. ``` -------------------------------- ### sign_event_builder Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Builds and signs an EventBuilder, returning the signed Event. Requires a NostrSigner. ```APIDOC ## sign_event_builder ### Description Build, sign and return `Event`. This method requires a `NostrSigner`. ### Method `async fn sign_event_builder(&self, builder: EventBuilder) -> Result` ``` -------------------------------- ### Client::reset Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Asynchronously resets the client to a default state, simplifying account switching. This includes unsubscribing, disconnecting relays, and unsetting the signer. ```APIDOC ## Client::reset ### Description Reset the client. This method resets the client to simplify the switch to another account. This method will: * unsubscribe from all subscriptions * disconnect and force remove all relays * unset the signer This method will NOT: * reset `ClientOptions` * remove the database * clear the gossip graph ### Signature ```rust pub async fn reset(&self) ``` ``` -------------------------------- ### Client::database Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Returns a reference to the `NostrDatabase` used by the client. ```APIDOC ## Client::database ### Description Get database. ### Signature ```rust pub fn database(&self) -> &Arc ``` ``` -------------------------------- ### ClientBuilder Struct Definition Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Defines the structure of the ClientBuilder, outlining its configurable fields. ```rust pub struct ClientBuilder { pub signer: Option>, pub websocket_transport: Arc, pub admit_policy: Option>, pub database: Arc, pub monitor: Option, pub opts: ClientOptions, } ``` -------------------------------- ### Configure Autoconnect Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Sets whether the client should automatically connect to relays upon initialization. Defaults to false. ```rust pub fn autoconnect(self, val: bool) -> Self ``` -------------------------------- ### Reset Client Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Reset the client to a default state, which includes unsubscribing from all relays, disconnecting, and unsetting the signer. Note that `ClientOptions`, the database, and the gossip graph are not affected. ```rust pub async fn reset(&self) ``` -------------------------------- ### ClientOptions::sleep_when_idle Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Configures the sleep-when-idle behavior for the client. ```APIDOC ## ClientOptions::sleep_when_idle ### Description Set sleep when idle config. ### Method ```rust pub fn sleep_when_idle(self, config: SleepWhenIdle) -> Self ``` ``` -------------------------------- ### Configure Relay Limits Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Sets specific limits for relay connections. ```rust pub fn relay_limits(self, limits: RelayLimits) -> Self ``` -------------------------------- ### WithSubscriber Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Methods for attaching subscribers to a type. ```APIDOC ## with_subscriber ### Description Attaches the provided `Subscriber` to this type, returning a `WithDispatch` wrapper. ### Method `with_subscriber(self, subscriber: S) -> WithDispatch` ### Type Parameters * `S`: A type that can be converted into a `Dispatch`. ``` ```APIDOC ## with_current_subscriber ### Description Attaches the current default `Subscriber` to this type, returning a `WithDispatch` wrapper. ### Method `with_current_subscriber(self) -> WithDispatch` ``` -------------------------------- ### Error Trait Implementation: provide Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/enum.Error.html Implements the `provide` method for experimental error reporting. This is a nightly-only feature. ```rust fn provide<'a>(&'a self, request: &mut Request<'a>) ``` -------------------------------- ### Configure Notification Channel Size Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Sets the size of the notification channel. This is deprecated and users should use Options::pool instead. ```rust pub fn notification_channel_size(self, size: usize) -> Self ``` -------------------------------- ### TryInto for T Implementation Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Provides a fallible conversion from type T into type U. ```APIDOC ### impl TryInto for T where U: TryFrom, ### type Error = >::Error The type returned in the event of a conversion error. ### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### Set Proxy Connection Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Configures the connection to use a proxy server at the specified address. ```rust pub fn proxy(self, addr: SocketAddr) -> Self ``` -------------------------------- ### VZip Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Provides a `vzip` method for zipping with a multi-lane type. ```APIDOC ## vzip ### Description Zips the type with a multi-lane type `V`. ### Method `vzip(self) -> V` ``` -------------------------------- ### Configure Sleep When Idle Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Sets the configuration for when the client should sleep if idle. ```rust pub fn sleep_when_idle(self, config: SleepWhenIdle) -> Self ``` -------------------------------- ### From Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Provides a `from` method for converting a type into itself. ```APIDOC ## from ### Description Returns the argument unchanged. ### Method `from(t: T) -> T` ``` -------------------------------- ### Send Event Builder to Relays Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Takes an `EventBuilder`, signs it using a `NostrSigner`, and broadcasts it to relays. See `Client::send_event` for more details. ```rust client.send_event_builder(builder).await? ``` -------------------------------- ### TryFrom Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Provides a `try_from` method for fallible type conversions. ```APIDOC ## try_from ### Description Performs the conversion. ### Method `try_from(value: U) -> Result>::Error>` ### Associated Types * `Error`: The type returned in the event of a conversion error. ``` -------------------------------- ### From Trait Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.ClientOptions.html Provides a conversion from a type to itself. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ``` -------------------------------- ### Downcast ClientBuilder to Any + Send Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Converts a boxed `ClientBuilder` into a `Box`, suitable for sending across threads. ```rust fn into_any_send(self: Box) -> Box ``` -------------------------------- ### ClientOptions::pool Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Sets relay pool options for the client. ```APIDOC ## ClientOptions::pool ### Description Set relay pool options. ### Method ```rust pub fn pool(self, opts: RelayPoolOptions) -> Self ``` ``` -------------------------------- ### Use Embedded Tor Client with Path Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Enables the use of an embedded Tor client and specifies a directory for storing Tor data. Requires the 'tor' crate feature. ```rust pub fn embedded_tor_with_path

(self, path: P) -> Self where P: AsRef ``` -------------------------------- ### Send Event Builder to Specific Relays Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Takes an `EventBuilder`, signs it using a `NostrSigner`, and broadcasts it to specific relays. See `Client::send_event_to` for more details. ```rust client.send_event_builder_to(urls, builder).await? ``` -------------------------------- ### Into for T Implementation Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Allows conversion of a type T into another type U, provided U implements From. ```APIDOC ### impl Into for T where U: From, ### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `From for U` chooses to do. ``` -------------------------------- ### TryFrom for T Implementation Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/struct.Connection.html Provides a fallible conversion from type U into type T. ```APIDOC ### impl TryFrom for T where U: Into, ### type Error = Infallible The type returned in the event of a conversion error. ### fn try_from(value: U) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### Client Borrowing Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Allows immutable and mutable borrowing of the client. ```APIDOC ## fn borrow(&self) -> &T ### Description Immutably borrows from an owned value. ### Method `borrow` ### Parameters None ### Response - **&T**: An immutable reference to the borrowed value. ``` ```APIDOC ## fn borrow_mut(&mut self) -> &mut T ### Description Mutably borrows from an owned value. ### Method `borrow_mut` ### Parameters None ### Response - **&mut T**: A mutable reference to the borrowed value. ``` -------------------------------- ### ClientOptions::automatic_authentication Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Configures automatic authentication to relays. ```APIDOC ## ClientOptions::automatic_authentication ### Description Auto authenticate to relays (default: true). See [NIP-42](https://github.com/nostr-protocol/nips/blob/master/42.md). ### Method ```rust pub fn automatic_authentication(self, enabled: bool) -> Self ``` ``` -------------------------------- ### ConnectionTargetNon-WebAssembly Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/index.html Specifies the target for a connection in non-WebAssembly environments. ```APIDOC ## Enum: ConnectionTargetNon-WebAssembly ### Description Represents the possible targets for a client connection when not running in a WebAssembly environment. ### Variants - **Connection**: Represents a direct connection. ``` -------------------------------- ### connect_with_timeout Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Deprecated: Use `connect` combined with `wait_for_connection` instead. Attempts to connect to all relays and waits for them to be connected within a given timeout. ```APIDOC ## connect_with_timeout ### Description Connect to all added relays. Try to connect to the relays and wait for them to be connected at most for the specified `timeout`. The code continues if the `timeout` is reached or if all relays connect. ### Method `pub async fn connect_with_timeout(&self, timeout: Duration)` ### Parameters #### Path Parameters - **timeout** (Duration): The maximum duration to wait for connections. ``` -------------------------------- ### subscribe Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/struct.Client.html Creates a new subscription with the given filter and optional auto-close options. Events will also be requested from NIP65 relays if gossip is enabled. ```APIDOC ## subscribe ### Description Subscribe to filters. This method create a new subscription. None of the previous subscriptions will be edited/closed when you call this! So remember to unsubscribe when you no longer need it. You can get all your active (non-auto-closing) subscriptions by calling `client.subscriptions().await`. If `gossip` is enabled (see `ClientOptions::gossip`) the events will be requested also to NIP65 relays (automatically discovered) of public keys included in filters (if any). ##### §Auto-closing subscription It’s possible to automatically close a subscription by configuring the `SubscribeAutoCloseOptions`. Note: auto-closing subscriptions aren’t saved in subscriptions map! ### Method `pub async fn subscribe( &self, filter: Filter, opts: Option, ) -> Result, Error>` ### Parameters #### Path Parameters - **filter** (Filter): The filter criteria for the subscription. - **opts** (Option): Optional configuration for auto-closing the subscription. ``` -------------------------------- ### Type Conversion: TryIntoSlug Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/enum.Error.html Attempts to convert a value into a `Slug` if it has the correct syntax. ```APIDOC ## fn try_into_slug(&self) -> Result ### Description Convert `self` into a `Slug`, if it has the right syntax. ### Method `try_into_slug` ``` -------------------------------- ### Downcast ClientBuilder to Any (Rc) Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/builder/struct.ClientBuilder.html Converts an `Rc` into an `Rc`, facilitating dynamic type inspection. ```rust fn into_any_rc(self: Rc) -> Rc ``` -------------------------------- ### ClientOptions::verify_subscriptions Source: https://docs.rs/nostr-sdk/0.43.0/nostr_sdk/client/options/type.Options.html Enables verification that received events belong to a subscription and match the filter. ```APIDOC ## ClientOptions::verify_subscriptions ### Description Verify that received events belong to a subscription and match the filter. ### Method ```rust pub fn verify_subscriptions(self, enable: bool) -> Self ``` ```