pub struct Sender<T, E>(/* private fields */);
Implementations§
Source§impl<T, E> Sender<T, E>
impl<T, E> Sender<T, E>
Sourcepub fn send(&self, n: T) -> Result<(), Error<E>>
pub fn send(&self, n: T) -> Result<(), Error<E>>
Send a single record to the receiver.
If the queue is currently full this call will block and wait for space to become available.
§Panic
If this function has already returned an application-defined error, then calling this method again will panic. Handle errors on first opportunity.
Sourcepub fn send_batch<I>(&self, it: I) -> Result<(), Error<E>>where
I: Iterator<Item = T>,
pub fn send_batch<I>(&self, it: I) -> Result<(), Error<E>>where
I: Iterator<Item = T>,
Send a batch of records.
All records will be transferred. If the queue is full, this call will block until space becomes available.
Sourcepub fn try_send(&self, n: T) -> Result<(), Error<E>>
pub fn try_send(&self, n: T) -> Result<(), Error<E>>
Non-blocking send.
Attempt to send a node.
Sourcepub fn send_async(&self, n: T) -> SendFuture<'_, T, E>
pub fn send_async(&self, n: T) -> SendFuture<'_, T, E>
Return a Future
that will send a record to the receiver or wait until
space becomes available in the queue.
§Cancel safety
The returned SendFuture
is not cancel safe.
Sourcepub fn send_batch_async<I>(&self, it: I) -> SendFuture<'_, T, E>where
I: Iterator<Item = T>,
pub fn send_batch_async<I>(&self, it: I) -> SendFuture<'_, T, E>where
I: Iterator<Item = T>,
Return a Future
that will send records to the receiver or wait until
space becomes available in the queue.
§Cancel safety
The returned SendFuture
is not cancel safe.
Trait Implementations§
Auto Trait Implementations§
impl<T, E> Freeze for Sender<T, E>
impl<T, E> !RefUnwindSafe for Sender<T, E>
impl<T, E> Send for Sender<T, E>
impl<T, E> Sync for Sender<T, E>
impl<T, E> Unpin for Sender<T, E>
impl<T, E> !UnwindSafe for Sender<T, E>
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