pub struct BusClient { /* private fields */ }Expand description
A module’s current connection and the task that maintains its credentials.
Implementations§
Source§impl BusClient
impl BusClient
Sourcepub async fn connect(
subc: Arc<SubcConsumer>,
opts: BusClientOptions,
) -> Result<Self>
pub async fn connect( subc: Arc<SubcConsumer>, opts: BusClientOptions, ) -> Result<Self>
Issues a credential for the module identity that the subc daemon authenticates from the module’s launch nonce.
Sourcepub fn connection(&self) -> NatsConnection
pub fn connection(&self) -> NatsConnection
Returns a snapshot. A re-issue does not change an already held snapshot.
Sourcepub fn connection_changes(&self) -> Receiver<u64>
pub fn connection_changes(&self) -> Receiver<u64>
Changes only after a replacement connection with a new inbox is ready. Reopen subscriptions and durable pulls when this receiver changes.
If credential maintenance can no longer renew or re-issue, its task ends
and drops the sender. The receiver’s changed() then returns Err once
any unseen change has been consumed. Reconnect with BusClient::connect
or report the module as degraded when the change stream closes.
pub fn acct(&self) -> &str
Trait Implementations§
Auto Trait Implementations§
impl Forget for BusClient
impl Freeze for BusClient
impl Move for BusClient
impl RefUnwindSafe for BusClient
impl Send for BusClient
impl Sync for BusClient
impl Unpin for BusClient
impl UnsafeUnpin for BusClient
impl UnwindSafe for BusClient
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