connect_with_auth

Function connect_with_auth 

Source
pub fn connect_with_auth(
    servers: impl IntoIterator<Item = impl ToString>,
    auth: &NatsAuth,
) -> Result<NatsClient, SdkError>
Expand description

Connects to one or more NATS servers with authentication

§Arguments

  • servers - Iterator of server addresses to connect to
  • auth - Authentication credentials for connecting to the servers

§Returns

Result containing the connected NATS client or an error if connection fails