pub struct Sender<T, B: Eq + Hash + Clone> { /* private fields */ }
Expand description
A sender that wraps Sender
and tracks message delivery.
Implementations§
Source§impl<T, B: Eq + Hash + Clone> Sender<T, B>
impl<T, B: Eq + Hash + Clone> Sender<T, B>
Sourcepub async fn send(
&mut self,
batch: Option<B>,
data: T,
) -> Result<u64, SendError>
pub async fn send( &mut self, batch: Option<B>, data: T, ) -> Result<u64, SendError>
Sends a message with an optional batch ID and returns a delivery guard.
Sourcepub fn try_send(
&mut self,
batch: Option<B>,
data: T,
) -> Result<u64, TrySendError<Message<T, B>>>
pub fn try_send( &mut self, batch: Option<B>, data: T, ) -> Result<u64, TrySendError<Message<T, B>>>
Tries to send a message without blocking.
Trait Implementations§
Auto Trait Implementations§
impl<T, B> Freeze for Sender<T, B>
impl<T, B> !RefUnwindSafe for Sender<T, B>
impl<T, B> Send for Sender<T, B>
impl<T, B> Sync for Sender<T, B>
impl<T, B> Unpin for Sender<T, B>
impl<T, B> !UnwindSafe for Sender<T, B>
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