Type Alias DeviceEventReceiver

Source
pub type DeviceEventReceiver = UnboundedReceiver<DeviceEvent>;

Aliased Type§

struct DeviceEventReceiver { /* private fields */ }

Implementations

§

impl<T> UnboundedReceiver<T>

pub fn close(&mut self)

Closes the receiving half of a channel, without dropping it.

This prevents any further messages from being sent on the channel while still enabling the receiver to drain messages that are buffered.

pub fn try_next(&mut self) -> Result<Option<T>, TryRecvError>

Tries to receive the next message without notifying a context if empty.

It is not recommended to call this function from inside of a future, only when you’ve otherwise arranged to be notified when the channel is no longer empty.

This function returns:

  • Ok(Some(t)) when message is fetched
  • Ok(None) when channel is closed and no messages left in the queue
  • Err(e) when there are no messages available, but channel is not yet closed

Trait Implementations

§

impl<T> Debug for UnboundedReceiver<T>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Drop for UnboundedReceiver<T>

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl<T> FusedStream for UnboundedReceiver<T>

§

fn is_terminated(&self) -> bool

Returns true if the stream should no longer be polled.
§

impl<T> Stream for UnboundedReceiver<T>

§

type Item = T

Values yielded by the stream.
§

fn poll_next( self: Pin<&mut UnboundedReceiver<T>>, cx: &mut Context<'_>, ) -> Poll<Option<T>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
§

impl<T> Unpin for UnboundedReceiver<T>