pub struct SupervisorHandle { /* private fields */ }Expand description
Handle to interact with a running Supervisor. Cheap to clone.
Implementations§
Source§impl SupervisorHandle
impl SupervisorHandle
Sourcepub async fn wait(&self) -> Result<(), SupervisorError>
pub async fn wait(&self) -> Result<(), SupervisorError>
Waits for the supervisor to finish. Safe to call from multiple clones concurrently.
pub fn add_task<T: SupervisedTask + Clone>( &self, task_name: &str, task: T, ) -> Result<(), SupervisorHandleError>
pub fn restart(&self, task_name: &str) -> Result<(), SupervisorHandleError>
pub fn kill_task(&self, task_name: &str) -> Result<(), SupervisorHandleError>
pub fn shutdown(&self) -> Result<(), SupervisorHandleError>
pub async fn get_task_status( &self, task_name: &str, ) -> Result<Option<TaskStatus>, SupervisorHandleError>
pub async fn get_all_task_statuses( &self, ) -> Result<HashMap<String, TaskStatus>, SupervisorHandleError>
Trait Implementations§
Source§impl Clone for SupervisorHandle
impl Clone for SupervisorHandle
Source§fn clone(&self) -> SupervisorHandle
fn clone(&self) -> SupervisorHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SupervisorHandle
impl Debug for SupervisorHandle
Auto Trait Implementations§
impl Freeze for SupervisorHandle
impl RefUnwindSafe for SupervisorHandle
impl Send for SupervisorHandle
impl Sync for SupervisorHandle
impl Unpin for SupervisorHandle
impl UnsafeUnpin for SupervisorHandle
impl UnwindSafe for SupervisorHandle
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