Struct tor_rtcompat::scheduler::TaskHandle
source · [−]pub struct TaskHandle { /* private fields */ }
Expand description
A handle used to control a TaskSchedule
.
Implementations
sourceimpl TaskHandle
impl TaskHandle
sourcepub fn fire(&self) -> bool
pub fn fire(&self) -> bool
Trigger this handle’s corresponding schedule now.
Returns true
if the schedule still exists, and false
otherwise.
sourcepub fn fire_at(&self, instant: Instant) -> bool
pub fn fire_at(&self, instant: Instant) -> bool
Trigger this handle’s corresponding schedule at instant
.
Returns true
if the schedule still exists, and false
otherwise.
sourcepub fn cancel(&self) -> bool
pub fn cancel(&self) -> bool
Cancel a pending firing of the handle’s corresponding schedule.
Returns true
if the schedule still exists, and false
otherwise.
sourcepub fn suspend(&self) -> bool
pub fn suspend(&self) -> bool
Suspend execution of the corresponding schedule.
If the schedule is ready now, it will become pending; it won’t become
ready again until resume()
is called. If the schedule is waiting for a
timer, the timer will keep counting, but the schedule won’t become ready
until the timer has elapsed and resume()
has been called.
Returns true
if the schedule still exists, and false
otherwise.
sourcepub fn resume(&self) -> bool
pub fn resume(&self) -> bool
Resume execution of the corresponding schedule.
This method undoes the effect of a call to suspend()
: the schedule
will fire again if it is ready (or when it becomes ready).
This method won’t cause the schedule to fire if it was already
cancelled. For that, use the fire()
or fire_at()` methods.
Returns true
if the schedule still exists, and false
otherwise.
Trait Implementations
sourceimpl Clone for TaskHandle
impl Clone for TaskHandle
sourcefn clone(&self) -> TaskHandle
fn clone(&self) -> TaskHandle
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for TaskHandle
impl Send for TaskHandle
impl Sync for TaskHandle
impl Unpin for TaskHandle
impl !UnwindSafe for TaskHandle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more