pub struct Sender { /* private fields */ }Expand description
Producer handle for the blocking event channel.
Cloneable for MPSC. Same conflation semantics as Notifier —
duplicate notifications are suppressed. Automatically wakes a
parked Receiver on any successful notification (including
conflated — a spurious wakeup is safe and self-correcting).
Obtained from event_channel().
Implementations§
Source§impl Sender
impl Sender
Sourcepub fn notify(&self, token: Token) -> Result<(), NotifyError>
pub fn notify(&self, token: Token) -> Result<(), NotifyError>
Signal that a token is ready.
Same semantics as Notifier::notify — conflated if already
flagged. Additionally, wakes the receiver if it’s parked.
Every successful notify (including conflated) checks the parked flag. A conflated notify may cause a spurious wakeup (receiver wakes, polls, finds nothing new, re-parks). This is safe and self-correcting. Correctness beats cleverness.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Sender
impl !RefUnwindSafe for Sender
impl Send for Sender
impl !Sync for Sender
impl Unpin for Sender
impl UnsafeUnpin for Sender
impl !UnwindSafe for Sender
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