Struct wash_lib::start::NatsConfig
source · pub struct NatsConfig {
pub host: String,
pub port: u16,
pub js_domain: Option<String>,
pub remote_url: Option<String>,
pub credentials: Option<PathBuf>,
}Expand description
Configuration for a NATS server that supports running either in “standalone” or “leaf” mode. See the respective NatsConfig::new_standalone and NatsConfig::new_leaf implementations below for more information.
Fields§
§host: String§port: u16§js_domain: Option<String>§remote_url: Option<String>§credentials: Option<PathBuf>Implementations§
source§impl NatsConfig
impl NatsConfig
sourcepub fn new_leaf(
host: &str,
port: u16,
js_domain: Option<String>,
remote_url: String,
credentials: PathBuf
) -> Self
pub fn new_leaf( host: &str, port: u16, js_domain: Option<String>, remote_url: String, credentials: PathBuf ) -> Self
Instantiates config for a NATS leaf node. Leaf nodes are meant to extend an existing NATS infrastructure like Synadia’s NGS, but can also be used to extend your own NATS infrastructure. For more information, our Working with Leaf Nodes docs
Arguments
host: NATS host to listen on, e.g.127.0.0.1port: NATS port to listen on, e.g.4222js_domain: Jetstream domain to use, defaults tocore. See Configuring Jetstream for more informationremote_url: URL of NATS cluster to extendcredentials: Credentials to authenticate to the existing NATS cluster
sourcepub fn new_standalone(host: &str, port: u16, js_domain: Option<String>) -> Self
pub fn new_standalone(host: &str, port: u16, js_domain: Option<String>) -> Self
Instantiates config for a standalone NATS server. Unless you’re looking to extend existing NATS infrastructure, this is the preferred NATS server mode.
Arguments
host: NATS host to listen on, e.g.127.0.0.1port: NATS port to listen on, e.g.4222js_domain: Jetstream domain to use, defaults tocore. See Configuring Jetstream for more information
Trait Implementations§
source§impl Clone for NatsConfig
impl Clone for NatsConfig
source§fn clone(&self) -> NatsConfig
fn clone(&self) -> NatsConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl RefUnwindSafe for NatsConfig
impl Send for NatsConfig
impl Sync for NatsConfig
impl Unpin for NatsConfig
impl UnwindSafe for NatsConfig
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
Mutably borrows from an owned value. Read more