pub struct TaskManager { /* private fields */ }Expand description
Manages background task lifecycle.
Implementations§
Source§impl TaskManager
impl TaskManager
pub fn new() -> Self
Sourcepub async fn spawn_shell(
&self,
command: &str,
description: &str,
cwd: &Path,
) -> Result<TaskId, String>
pub async fn spawn_shell( &self, command: &str, description: &str, cwd: &Path, ) -> Result<TaskId, String>
Spawn a background shell command.
Sourcepub async fn get_status(&self, id: &str) -> Option<TaskInfo>
pub async fn get_status(&self, id: &str) -> Option<TaskInfo>
Get the status of a task.
Sourcepub async fn read_output(&self, id: &str) -> Result<String, String>
pub async fn read_output(&self, id: &str) -> Result<String, String>
Read the output of a completed task.
Sourcepub async fn drain_completions(&self) -> Vec<TaskInfo>
pub async fn drain_completions(&self) -> Vec<TaskInfo>
Collect notifications for newly completed tasks.
Auto Trait Implementations§
impl Freeze for TaskManager
impl !RefUnwindSafe for TaskManager
impl Send for TaskManager
impl Sync for TaskManager
impl Unpin for TaskManager
impl UnsafeUnpin for TaskManager
impl !UnwindSafe for TaskManager
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