pub enum ChannelMsg {
Value(Value),
Closed,
}Expand description
Message type for plain channels.
Mirrors WeaveMessage: wrapping the underlying may::mpmc queue
in a typed enum lets lifecycle signals travel through the same
channel as user data without any value collision. chan.close
sends one Closed sentinel; receivers re-broadcast it so all
blocked consumers in an MPMC fan-out wake up. See issue #499 and
docs/design/CHAN_CLOSE_SEMANTICS.md.
Variants§
Value(Value)
Normal value being sent through the channel.
Closed
Channel-closed sentinel — chan.close sends one of these on
the first close; chan.receive re-sends it before returning
failure so the next blocked receiver also wakes.
Trait Implementations§
Source§impl Clone for ChannelMsg
impl Clone for ChannelMsg
Source§fn clone(&self) -> ChannelMsg
fn clone(&self) -> ChannelMsg
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChannelMsg
impl Debug for ChannelMsg
Source§impl PartialEq for ChannelMsg
impl PartialEq for ChannelMsg
impl StructuralPartialEq for ChannelMsg
Auto Trait Implementations§
impl Freeze for ChannelMsg
impl RefUnwindSafe for ChannelMsg
impl Send for ChannelMsg
impl Sync for ChannelMsg
impl Unpin for ChannelMsg
impl UnsafeUnpin for ChannelMsg
impl UnwindSafe for ChannelMsg
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