pub struct CommandReceiver(pub UnboundedReceiver<CommandQueue>);
Expand description
Resource
used to receive command queues. These command queues are handled with handle_tasks
.
Tuple Fields§
§0: UnboundedReceiver<CommandQueue>
Methods from Deref<Target = UnboundedReceiver<CommandQueue>>§
Sourcepub fn close(&mut self)
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.
Sourcepub fn try_next(&mut self) -> Result<Option<T>, TryRecvError>
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 fetchedOk(None)
when channel is closed and no messages left in the queueErr(e)
when there are no messages available, but channel is not yet closed
Trait Implementations§
Source§impl AsMut<UnboundedReceiver<CommandQueue>> for CommandReceiver
impl AsMut<UnboundedReceiver<CommandQueue>> for CommandReceiver
Source§fn as_mut(&mut self) -> &mut UnboundedReceiver<CommandQueue>
fn as_mut(&mut self) -> &mut UnboundedReceiver<CommandQueue>
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<UnboundedReceiver<CommandQueue>> for CommandReceiver
impl AsRef<UnboundedReceiver<CommandQueue>> for CommandReceiver
Source§fn as_ref(&self) -> &UnboundedReceiver<CommandQueue>
fn as_ref(&self) -> &UnboundedReceiver<CommandQueue>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Debug for CommandReceiver
impl Debug for CommandReceiver
Source§impl DerefMut for CommandReceiver
impl DerefMut for CommandReceiver
Source§impl Deref for CommandReceiver
impl Deref for CommandReceiver
Source§type Target = UnboundedReceiver<CommandQueue>
type Target = UnboundedReceiver<CommandQueue>
The resulting type after dereferencing.
impl Resource for CommandReceiver
Auto Trait Implementations§
impl Freeze for CommandReceiver
impl !RefUnwindSafe for CommandReceiver
impl Send for CommandReceiver
impl Sync for CommandReceiver
impl Unpin for CommandReceiver
impl !UnwindSafe for CommandReceiver
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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