pub struct BackgroundShellManager { /* private fields */ }Expand description
Manages background shell sessions - matches WCGW Python’s background_shells dict
Implementations§
Source§impl BackgroundShellManager
impl BackgroundShellManager
Sourcepub fn register_shell(
&mut self,
owner_thread_id: &str,
shell: PtyShell,
) -> Result<String>
pub fn register_shell( &mut self, owner_thread_id: &str, shell: PtyShell, ) -> Result<String>
Start a new background shell and return its command ID Register an already-built shell and return its id.
The caller builds the PtyShell BEFORE taking the manager lock —
PtyShell::new forks+execs and does a ~300ms blocking prompt init, which
must not run under the global std::Mutex (it would serialize every other
background-shell op behind one slow spawn).
Sourcepub fn get_shell(
&self,
owner_thread_id: &str,
bg_command_id: &str,
) -> Option<SharedPtyShell>
pub fn get_shell( &self, owner_thread_id: &str, bg_command_id: &str, ) -> Option<SharedPtyShell>
Get a background shell by its command ID
Sourcepub fn remove_shell(&mut self, bg_command_id: &str) -> bool
pub fn remove_shell(&mut self, bg_command_id: &str) -> bool
Remove and cleanup a background shell
Sourcepub fn peek_tombstone(
&self,
owner_thread_id: &str,
bg_command_id: &str,
) -> Option<ExitedShellInfo>
pub fn peek_tombstone( &self, owner_thread_id: &str, bg_command_id: &str, ) -> Option<ExitedShellInfo>
Look up the tombstone for a recently-exited shell, if any.
The entry stays in the map until the TTL expires (see
prune_finished_shells), so repeated status_check calls on the same
bg_command_id keep returning the cached final output instead of
flipping to “shell not found” after the first read.
Sourcepub fn ids_for(&self, owner_thread_id: &str) -> Vec<String>
pub fn ids_for(&self, owner_thread_id: &str) -> Vec<String>
Get info about all running background shells - matches WCGW Python get_bg_running_commandsinfo
Ids of the live background shells owned by owner_thread_id, sorted
for stable output. Read-only: finished shells are not pruned here.
pub fn get_running_info(&mut self, owner_thread_id: &str) -> String
Trait Implementations§
Source§impl Debug for BackgroundShellManager
impl Debug for BackgroundShellManager
Auto Trait Implementations§
impl !RefUnwindSafe for BackgroundShellManager
impl !UnwindSafe for BackgroundShellManager
impl Freeze for BackgroundShellManager
impl Send for BackgroundShellManager
impl Sync for BackgroundShellManager
impl Unpin for BackgroundShellManager
impl UnsafeUnpin for BackgroundShellManager
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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