pub struct Receiver<R: Deref<Target = State<Q, F, E>>, Q, F, E> { /* private fields */ }Expand description
Allows receiving data from the SPSC channel via its BulkProducer implementation.
Implementations§
Trait Implementations§
Source§impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> BufferedProducer for Receiver<R, Q, F, E>
impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> BufferedProducer for Receiver<R, Q, F, E>
Source§impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> BulkProducer for Receiver<R, Q, F, E>
impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> BulkProducer for Receiver<R, Q, F, E>
Source§async fn expose_items<'a>(
&'a mut self,
) -> Result<Either<&'a [Self::Item], Self::Final>, Self::Error>where
Self::Item: 'a,
async fn expose_items<'a>(
&'a mut self,
) -> Result<Either<&'a [Self::Item], Self::Final>, Self::Error>where
Self::Item: 'a,
A low-level method for producing multiple items at a time. If you are only working with producers (rather than implementing them), you will probably want to ignore this method and use BulkProducer::bulk_produce instead. Read more
Source§async fn consider_produced(&mut self, amount: usize) -> Result<(), Self::Error>
async fn consider_produced(&mut self, amount: usize) -> Result<(), Self::Error>
A low-level method for producing multiple items at a time. If you are only working with producers (rather than implementing them), you will probably want to ignore this method and use BulkProducer::bulk_produce instead. Read more
Source§fn bulk_produce(
&mut self,
buf: &mut [Self::Item],
) -> impl Future<Output = Result<Either<usize, Self::Final>, Self::Error>>
fn bulk_produce( &mut self, buf: &mut [Self::Item], ) -> impl Future<Output = Result<Either<usize, Self::Final>, Self::Error>>
Produces a non-zero number of items by writing them into a given buffer and returning how
many items were produced. Read more
Source§fn bulk_overwrite_full_slice(
&mut self,
buf: &mut [Self::Item],
) -> impl Future<Output = Result<(), ProduceAtLeastError<Self::Final, Self::Error>>>
fn bulk_overwrite_full_slice( &mut self, buf: &mut [Self::Item], ) -> impl Future<Output = Result<(), ProduceAtLeastError<Self::Final, Self::Error>>>
Tries to completely overwrite a slice with items from a bulk producer.
Reports an error if the slice could not be overwritten completely. Read more
Source§impl<R: Debug + Deref<Target = State<Q, F, E>>, Q: Debug, F: Debug, E: Debug> Debug for Receiver<R, Q, F, E>
impl<R: Debug + Deref<Target = State<Q, F, E>>, Q: Debug, F: Debug, E: Debug> Debug for Receiver<R, Q, F, E>
Source§impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> Producer for Receiver<R, Q, F, E>
impl<R: Deref<Target = State<Q, F, E>>, Q: Queue, F, E> Producer for Receiver<R, Q, F, E>
Source§async fn produce(
&mut self,
) -> Result<Either<Self::Item, Self::Final>, Self::Error>
async fn produce( &mut self, ) -> Result<Either<Self::Item, Self::Final>, Self::Error>
Take an item from the buffer queue, waiting for an item to
become available (by being consumed by the corresponding Sender) if necessary.
Source§type Item = <Q as Queue>::Item
type Item = <Q as Queue>::Item
The sequence produced by this producer starts with arbitrarily many values of this type.
Source§fn produce_item(
&mut self,
) -> impl Future<Output = Result<Self::Item, ProduceAtLeastError<Self::Final, Self::Error>>>
fn produce_item( &mut self, ) -> impl Future<Output = Result<Self::Item, ProduceAtLeastError<Self::Final, Self::Error>>>
Tries to produce a regular item, and reports an error if the final item was produced instead. Read more
Auto Trait Implementations§
impl<R, Q, F, E> Freeze for Receiver<R, Q, F, E>where
R: Freeze,
impl<R, Q, F, E> RefUnwindSafe for Receiver<R, Q, F, E>
impl<R, Q, F, E> Send for Receiver<R, Q, F, E>
impl<R, Q, F, E> Sync for Receiver<R, Q, F, E>
impl<R, Q, F, E> Unpin for Receiver<R, Q, F, E>
impl<R, Q, F, E> UnwindSafe for Receiver<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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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