pub struct TaskHandle {
pub id: u64,
pub state: TaskState,
pub priority: TaskPriority,
}Expand description
Handle to a scheduled asynchronous task.
Combines the task’s unique identifier with its current state and priority, allowing the caller to inspect and manage task lifecycle.
Fields§
§id: u64Unique task identifier.
state: TaskStateCurrent execution state.
priority: TaskPriorityScheduling priority.
Implementations§
Source§impl TaskHandle
impl TaskHandle
Sourcepub fn new(id: u64) -> Self
pub fn new(id: u64) -> Self
Create a new task handle in the Pending state with Normal priority.
Sourcepub fn with_priority(id: u64, priority: TaskPriority) -> Self
pub fn with_priority(id: u64, priority: TaskPriority) -> Self
Create a new task handle in the Pending state with the given priority.
Trait Implementations§
Source§impl Clone for TaskHandle
impl Clone for TaskHandle
Source§fn clone(&self) -> TaskHandle
fn clone(&self) -> TaskHandle
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TaskHandle
impl Debug for TaskHandle
Source§impl PartialEq for TaskHandle
impl PartialEq for TaskHandle
impl Copy for TaskHandle
impl Eq for TaskHandle
impl StructuralPartialEq for TaskHandle
Auto Trait Implementations§
impl Freeze for TaskHandle
impl RefUnwindSafe for TaskHandle
impl Send for TaskHandle
impl Sync for TaskHandle
impl Unpin for TaskHandle
impl UnwindSafe for TaskHandle
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)