pub struct TaskHandle {
pub id: TaskId,
/* private fields */
}Expand description
Handle to a running task for control and monitoring.
Fields§
§id: TaskIdTask ID
Implementations§
Source§impl TaskHandle
impl TaskHandle
Sourcepub async fn send_control(
&self,
cmd: TaskControl,
) -> Result<(), SendError<TaskControl>>
pub async fn send_control( &self, cmd: TaskControl, ) -> Result<(), SendError<TaskControl>>
Send a control command to the task.
Sourcepub async fn foreground(&self) -> Result<(), SendError<TaskControl>>
pub async fn foreground(&self) -> Result<(), SendError<TaskControl>>
Move task to foreground.
Sourcepub async fn background(&self) -> Result<(), SendError<TaskControl>>
pub async fn background(&self) -> Result<(), SendError<TaskControl>>
Move task to background.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskHandle
impl !RefUnwindSafe for TaskHandle
impl Send for TaskHandle
impl Sync for TaskHandle
impl Unpin for TaskHandle
impl UnsafeUnpin for TaskHandle
impl !UnwindSafe for TaskHandle
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