pub struct CancelSignal(/* private fields */);Expand description
A one-way, clonable cancellation signal with children, using std only.
Raising a signal raises every child created from it; a child can be
raised alone.
Implementations§
Source§impl CancelSignal
impl CancelSignal
pub fn new() -> Self
pub fn raise(&self)
pub fn is_raised(&self) -> bool
Sourcepub fn child(&self) -> CancelSignal
pub fn child(&self) -> CancelSignal
A signal raised when this one is, or on its own.
Sourcepub fn poll_raised(&self, cx: &mut Context<'_>) -> Poll<()>
pub fn poll_raised(&self, cx: &mut Context<'_>) -> Poll<()>
Ready once raised; registers the task’s waker otherwise.
Sourcepub fn registered(&self) -> usize
pub fn registered(&self) -> usize
Wakers and live children registered on this signal, for diagnostics: a signal shared across many waiters must not accumulate them.
Trait Implementations§
Source§impl Clone for CancelSignal
impl Clone for CancelSignal
Source§impl Debug for CancelSignal
impl Debug for CancelSignal
Auto Trait Implementations§
impl Freeze for CancelSignal
impl RefUnwindSafe for CancelSignal
impl Send for CancelSignal
impl Sync for CancelSignal
impl Unpin for CancelSignal
impl UnsafeUnpin for CancelSignal
impl UnwindSafe for CancelSignal
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