Skip to main content

connect_nats_with_creds

Function connect_nats_with_creds 

Source
pub(crate) async fn connect_nats_with_creds(
    servers: Vec<ServerAddr>,
    creds_path: String,
) -> Result<Client, Box<dyn Error + Send + Sync>>
Expand description

Connects to NATS with a credentials file and explicit server list.

§Arguments

  • servers - Server addresses to connect to.
  • creds_path - Path of the NATS credentials file.

§Errors

Returns an error if the credentials file cannot be loaded or the connection fails.