pub struct ChannelData {
pub sender: Sender<ChannelMsg>,
pub receiver: Receiver<ChannelMsg>,
pub closed: Arc<AtomicBool>,
}Expand description
Channel data: holds sender, receiver, and a closed flag.
Both sender and receiver are Clone (MPMC), so duplicating a
Channel value just clones the Arc. Send/receive operations use
the handles directly with zero mutex overhead — the closed
flag is a single atomic load on the send hot path, no locking.
Fields§
§sender: Sender<ChannelMsg>§receiver: Receiver<ChannelMsg>§closed: Arc<AtomicBool>Set by chan.close. Reads gate chan.send; the close itself
also enqueues one ChannelMsg::Closed sentinel to wake any
already-blocked receivers.
Trait Implementations§
Source§impl Clone for ChannelData
impl Clone for ChannelData
Source§fn clone(&self) -> ChannelData
fn clone(&self) -> ChannelData
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 ChannelData
impl Debug for ChannelData
Auto Trait Implementations§
impl Freeze for ChannelData
impl RefUnwindSafe for ChannelData
impl Send for ChannelData
impl Sync for ChannelData
impl Unpin for ChannelData
impl UnsafeUnpin for ChannelData
impl UnwindSafe for ChannelData
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