pub struct ProcessManager { /* private fields */ }Expand description
Global process session manager.
Implementations§
Source§impl ProcessManager
impl ProcessManager
Sourcepub fn spawn(
&mut self,
command: &str,
working_dir: &str,
timeout_secs: Option<u64>,
) -> Result<SessionId, String>
pub fn spawn( &mut self, command: &str, working_dir: &str, timeout_secs: Option<u64>, ) -> Result<SessionId, String>
Start a new background process.
Sourcepub fn insert(&mut self, session: ExecSession) -> SessionId
pub fn insert(&mut self, session: ExecSession) -> SessionId
Insert an existing session into the manager.
Sourcepub fn get(&self, id: &str) -> Option<&ExecSession>
pub fn get(&self, id: &str) -> Option<&ExecSession>
Get a session by ID.
Sourcepub fn get_mut(&mut self, id: &str) -> Option<&mut ExecSession>
pub fn get_mut(&mut self, id: &str) -> Option<&mut ExecSession>
Get a mutable session by ID.
Sourcepub fn list(&self) -> Vec<&ExecSession>
pub fn list(&self) -> Vec<&ExecSession>
List all sessions.
Sourcepub fn list_active(&self) -> Vec<&ExecSession>
pub fn list_active(&self) -> Vec<&ExecSession>
List active (running) sessions.
Sourcepub fn remove(&mut self, id: &str) -> Option<ExecSession>
pub fn remove(&mut self, id: &str) -> Option<ExecSession>
Remove a session.
Sourcepub fn clear_completed(&mut self)
pub fn clear_completed(&mut self)
Clear completed sessions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcessManager
impl RefUnwindSafe for ProcessManager
impl Send for ProcessManager
impl Sync for ProcessManager
impl Unpin for ProcessManager
impl UnwindSafe for ProcessManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more