pub struct NatsPublisher { /* private fields */ }Expand description
The live Core NATS publisher. Cheap to clone.
Exists only from a ConnectedNatsBroker, so it always has a connection. It aliases that
connection, though, and may outlive it: after the broker shuts down every publish reports
NatsError::Closed instead of silently succeeding against a dead connection.
Trait Implementations§
Source§impl Clone for NatsPublisher
impl Clone for NatsPublisher
Source§fn clone(&self) -> NatsPublisher
fn clone(&self) -> NatsPublisher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NatsPublisher
impl Debug for NatsPublisher
Source§impl Publisher for NatsPublisher
impl Publisher for NatsPublisher
Source§async fn publish(&self, msg: OutgoingMessage<'_>) -> Result<(), Self::Error>
async fn publish(&self, msg: OutgoingMessage<'_>) -> Result<(), Self::Error>
§Cancel safety
Core NATS publishing is fire-and-forget: the message is handed to the connection’s writer without waiting for the server. Dropping the future may leave the message either sent or unsent, with no way to tell which.
Source§impl RequestReply for NatsPublisher
impl RequestReply for NatsPublisher
Auto Trait Implementations§
impl !RefUnwindSafe for NatsPublisher
impl !UnwindSafe for NatsPublisher
impl Freeze for NatsPublisher
impl Send for NatsPublisher
impl Sync for NatsPublisher
impl Unpin for NatsPublisher
impl UnsafeUnpin for NatsPublisher
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