pub struct Sender<R: Deref<Target = State<Q, F, E>>, Q, F, E> { /* private fields */ }Expand description
Allows sending data to the SPSC channel via its BulkConsumer implementation.
Implementations§
Source§impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> Sender<R, Q, F, E>
impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> Sender<R, Q, F, E>
Sourcepub fn cause_error(&mut self, err: E)
pub fn cause_error(&mut self, err: E)
Sets an error to be emitted on the corresponding Receiver.
The error is only emitted there when trying to produce values
via produce or expose_items (or any method calling one of these),
but never when slurping or calling consider_produced.
Must not call any of the Consumer, BufferedConsumer, or BulkProducer methods
on this Receiver after calling this function, nor close_sync.
May call this function at most once per Receiver.
Must not call this function after calling close or close_sync.
Sourcepub fn close_sync(&mut self, fin: F)
pub fn close_sync(&mut self, fin: F)
Same as calling Consumer::close, but sync. Must not use this multiple times, after calling close, or after calling cause_error.
Sourcepub fn is_receiver_dropped(&self) -> bool
pub fn is_receiver_dropped(&self) -> bool
Returns whether the correponding Receiver has been dropped already.
Trait Implementations§
Source§impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> BufferedConsumer for Sender<R, Q, F, E>
impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> BufferedConsumer for Sender<R, Q, F, E>
Source§impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> BulkConsumer for Sender<R, Q, F, E>
impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> BulkConsumer for Sender<R, Q, F, E>
Source§async fn expose_slots<'a>(
&'a mut self,
) -> Result<&'a mut [Self::Item], Self::Error>where
Self::Item: 'a,
async fn expose_slots<'a>(
&'a mut self,
) -> Result<&'a mut [Self::Item], Self::Error>where
Self::Item: 'a,
Source§async fn consume_slots(&mut self, amount: usize) -> Result<(), Self::Error>
async fn consume_slots(&mut self, amount: usize) -> Result<(), Self::Error>
Source§impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> Consumer for Sender<R, Q, F, E>
impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> Consumer for Sender<R, Q, F, E>
Source§async fn consume(&mut self, item_: Self::Item) -> Result<(), Self::Error>
async fn consume(&mut self, item_: Self::Item) -> Result<(), Self::Error>
Writes the item into the buffer queue, waiting for buffer space to
become available (by reading items from the corresponding Sender) if necessary.
Source§type Item = <Q as Queue>::Item
type Item = <Q as Queue>::Item
Source§type Error = Infallible
type Error = Infallible
Auto Trait Implementations§
impl<R, Q, F, E> Freeze for Sender<R, Q, F, E>where
R: Freeze,
impl<R, Q, F, E> RefUnwindSafe for Sender<R, Q, F, E>
impl<R, Q, F, E> Send for Sender<R, Q, F, E>
impl<R, Q, F, E> Sync for Sender<R, Q, F, E>
impl<R, Q, F, E> Unpin for Sender<R, Q, F, E>
impl<R, Q, F, E> UnwindSafe for Sender<R, Q, F, 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more