pub struct NatsServerCmd { /* private fields */ }nats only.Expand description
Configuration for the NATS server command-line arguments.
This struct allows you to customize the NATS server startup configuration by setting various options like authentication credentials and enabling features like JetStream.
§Example
use testcontainers_modules::nats::NatsServerCmd;
let cmd = NatsServerCmd::default()
.with_user("myuser")
.with_password("mypass")
.with_jetstream();Implementations§
Source§impl NatsServerCmd
impl NatsServerCmd
Sourcepub fn with_user(self, user: &str) -> Self
pub fn with_user(self, user: &str) -> Self
Sets the username for NATS server authentication.
This configures the NATS server to require authentication with the specified username.
Should be used together with with_password for complete authentication setup.
§Example
use testcontainers_modules::nats::NatsServerCmd;
let cmd = NatsServerCmd::default().with_user("myuser");Sourcepub fn with_password(self, password: &str) -> Self
pub fn with_password(self, password: &str) -> Self
Sets the password for NATS server authentication.
This configures the NATS server to require authentication with the specified password.
Should be used together with with_user for complete authentication setup.
§Example
use testcontainers_modules::nats::NatsServerCmd;
let cmd = NatsServerCmd::default()
.with_user("myuser")
.with_password("mypass");Sourcepub fn with_jetstream(self) -> Self
pub fn with_jetstream(self) -> Self
Enable JetStream in the Nats server to use the built-in persistence features of NATS.
See: https://docs.nats.io/nats-concepts/jetstream
Example:
let nats_cmd = NatsServerCmd::default().with_jetstream();
let node = Nats::default().with_cmd(&nats_cmd).start().await?;Trait Implementations§
Source§impl Clone for NatsServerCmd
impl Clone for NatsServerCmd
Source§fn clone(&self) -> NatsServerCmd
fn clone(&self) -> NatsServerCmd
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NatsServerCmd
impl Debug for NatsServerCmd
Source§impl Default for NatsServerCmd
impl Default for NatsServerCmd
Source§fn default() -> NatsServerCmd
fn default() -> NatsServerCmd
Source§impl IntoIterator for &NatsServerCmd
impl IntoIterator for &NatsServerCmd
Auto Trait Implementations§
impl Freeze for NatsServerCmd
impl RefUnwindSafe for NatsServerCmd
impl Send for NatsServerCmd
impl Sync for NatsServerCmd
impl Unpin for NatsServerCmd
impl UnwindSafe for NatsServerCmd
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request