pub struct NatsProvider { /* private fields */ }Expand description
Where a NATS provider serves: its tenant and the NATS it connects to.
Implementations§
Source§impl NatsProvider
impl NatsProvider
Sourcepub fn new(
tenant: impl Into<String>,
url: impl Into<String>,
auth: NatsAuth,
) -> Result<Self>
pub fn new( tenant: impl Into<String>, url: impl Into<String>, auth: NatsAuth, ) -> Result<Self>
A provider of the tenant tenant on the NATS servers url (a
comma-separated list), authenticated by auth.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
The provider CUFFLINK_TENANT, NATS_URL (nats://localhost:4222
when unset) and the NATS credentials of the environment describe.
pub fn tenant(&self) -> &str
Trait Implementations§
Source§impl Clone for NatsProvider
impl Clone for NatsProvider
Auto Trait Implementations§
impl Freeze for NatsProvider
impl RefUnwindSafe for NatsProvider
impl Send for NatsProvider
impl Sync for NatsProvider
impl Unpin for NatsProvider
impl UnsafeUnpin for NatsProvider
impl UnwindSafe for NatsProvider
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