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, LJMError>
Expand description

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

§Arguments

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

§Errors

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