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 recv(&mut self) -> Recv<'_, UnboundedReceiver<T>>
pub fn recv(&mut self) -> Recv<'_, UnboundedReceiver<T>>
Waits for a message from the channel.
If the channel is empty and closed, returns RecvError.
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>
👎Deprecated: please use try_recv instead
pub fn try_next(&mut self) -> Result<Option<T>, TryRecvError>
please use try_recv instead
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
Sourcepub fn try_recv(&mut self) -> Result<T, TryRecvError>
pub fn try_recv(&mut self) -> Result<T, TryRecvError>
Tries to receive a message from the channel without blocking. If the channel is empty, or empty and closed, this method returns an error.
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>
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>
Source§impl Debug for CommandReceiver
impl Debug for CommandReceiver
Source§impl Deref for CommandReceiver
impl Deref for CommandReceiver
Source§type Target = UnboundedReceiver<CommandQueue>
type Target = UnboundedReceiver<CommandQueue>
Source§impl DerefMut for CommandReceiver
impl DerefMut for CommandReceiver
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 UnsafeUnpin 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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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>
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