pub(crate) fn cancel(&self) {
        unsafe {
            let state = &mut (*(self as *const Self as *mut Self)).state;

            // If the task has been completed or closed, it can't be cancelled.
            if *state & (COMPLETED | CLOSED) != 0 {
                return;
            }

            // Mark the task as closed.
            *state = *state | CLOSED;
            // Notify the awaiter that the task has been closed.
            if *state & AWAITER != 0 {
                self.notify();
            }
        }
    }
/// Cancels the task.
///
/// This method will only mark the task as closed and will notify the awaiter, but it won't
/// reschedule the task if it's not completed.
Cancels the task.
This method will only mark the task as closed and will notify the awaiter, but it won't
reschedule the task if it's not completed.
Cancels the task . This method will only mark the task as closed and will notify the awaiter but it won ' t reschedule the task if it ' s not completed .
pub(crate) fn cancel(&self) {
        unsafe {
            let state = &mut (*(self as *const Self as *mut Self)).state;
            // If the task has been completed or closed, it can't be cancelled.
            if *state & (COMPLETED | CLOSED) != 0 {
                return;
            }
            // Mark the task as closed.
            *state = *state | CLOSED;
            // Notify the awaiter that the task has been closed.
            if *state & AWAITER != 0 {
                self.notify();
            }
        }
    }
pub ( crate ) fn cancel ( & self ) { unsafe { let state = & mut ( * ( self as * const Self as * mut Self ) ) . state ; // If the task has been completed or closed, it can't be cancelled. if * state & ( COMPLETED | CLOSED ) != 0 { return ; } // Mark the task as closed. * state = * state | CLOSED ; // Notify the awaiter that the task has been closed. if * state & AWAITER != 0 { self . notify ( ) ; } } }
Cancels the task.
Cancels the task .
&self
&self