pub struct ChannelCore { /* private fields */ }Expand description
Shared state between a Tx/Rx pair created by channel().
Contains a Mutex<Option<ChannelBinding>> that is written once during
binding and read/taken by the paired handle. The mutex is only locked
during binding (once) and on first use by the paired handle (once).
Implementations§
Source§impl ChannelCore
impl ChannelCore
Sourcepub fn set_binding(&self, binding: ChannelBinding)
pub fn set_binding(&self, binding: ChannelBinding)
Store a binding in the core. Panics if already set.
Sourcepub fn get_sink(&self) -> Option<Arc<dyn ChannelSink>>
pub fn get_sink(&self) -> Option<Arc<dyn ChannelSink>>
Clone the sink from the core (for Tx reading the sink). Returns None if no sink has been set or if the binding is a Receiver.
Sourcepub fn take_receiver(&self) -> Option<Receiver<IncomingChannelMessage>>
pub fn take_receiver(&self) -> Option<Receiver<IncomingChannelMessage>>
Take the receiver out of the core (for Rx on first recv). Returns None if no receiver has been set or if it was already taken.
Auto Trait Implementations§
impl !Freeze for ChannelCore
impl RefUnwindSafe for ChannelCore
impl Send for ChannelCore
impl Sync for ChannelCore
impl Unpin for ChannelCore
impl UnsafeUnpin for ChannelCore
impl UnwindSafe for ChannelCore
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