pub struct Process { /* private fields */ }Expand description
A configured process managed by the workspace: an agent, terminal, or command.
Implementations§
Source§impl Process
impl Process
Sourcepub fn name(&self) -> &ProcessName
pub fn name(&self) -> &ProcessName
Display name shown in the sidebar.
Sourcepub fn kind(&self) -> &ProcessKind
pub fn kind(&self) -> &ProcessKind
Section the process belongs to.
Sourcepub fn agent_tool(&self) -> &Option<AgentTool>
pub fn agent_tool(&self) -> &Option<AgentTool>
Agent preset used for provider-aware activity detection.
Sourcepub fn agent_session_id(&self) -> &Option<AgentSessionId>
pub fn agent_session_id(&self) -> &Option<AgentSessionId>
Durable identity when this process is a first-class agent session.
Sourcepub fn origin(&self) -> &ProcessOrigin
pub fn origin(&self) -> &ProcessOrigin
Whether configuration or runtime session history owns the process.
Sourcepub fn command(&self) -> &Option<CommandLine>
pub fn command(&self) -> &Option<CommandLine>
Command used to launch it, or the user’s login shell when absent.
Sourcepub fn working_dir(&self) -> &Option<PathBuf>
pub fn working_dir(&self) -> &Option<PathBuf>
Working directory to launch in; inherits the workspace cwd when absent.
Sourcepub fn description(&self) -> &Option<Description>
pub fn description(&self) -> &Option<Description>
Optional secondary line under the name in the sidebar.
Sourcepub fn state(&self) -> &ProcessState
pub fn state(&self) -> &ProcessState
Current lifecycle state.
Sourcepub fn restart(&self) -> &RestartPolicy
pub fn restart(&self) -> &RestartPolicy
Restart policy governing what happens when the child exits.
Sourcepub fn stop(&self) -> &Option<StopPolicy>
pub fn stop(&self) -> &Option<StopPolicy>
Optional graceful shutdown policy, valid only for command processes.
Sourcepub fn autostart(&self) -> &bool
pub fn autostart(&self) -> &bool
Whether this process launches automatically when its workspace loads.
Sourcepub fn activity(&self) -> &ActivityState
pub fn activity(&self) -> &ActivityState
What the process appears to be doing, inferred from its terminal signals.
Source§impl Process
impl Process
Sourcepub fn builder() -> ProcessBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ProcessBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building Process.
On the builder, call .id(...), .name(...), .kind(...), .agent_tool(...)(optional), .agent_session_id(...)(optional), .origin(...)(optional), .command(...)(optional), .working_dir(...)(optional), .description(...)(optional), .state(...)(optional), .restart(...)(optional), .stop(...)(optional), .autostart(...)(optional), .activity(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of Process.
Source§impl Process
impl Process
Sourcepub fn set_state(&mut self, state: ProcessState)
pub fn set_state(&mut self, state: ProcessState)
Transitions the process to a new lifecycle state.
Sourcepub fn set_autostart(&mut self, autostart: bool)
pub fn set_autostart(&mut self, autostart: bool)
Sets whether this process auto-starts when its workspace loads.
Sourcepub fn set_activity(&mut self, activity: ActivityState)
pub fn set_activity(&mut self, activity: ActivityState)
Updates the inferred activity of the process.
Sourcepub fn effective_stop_policy(&self) -> Option<StopPolicy>
pub fn effective_stop_policy(&self) -> Option<StopPolicy>
The effective graceful shutdown policy. Commands use the domain default when their config omits an override; other process kinds have no policy.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Process
impl RefUnwindSafe for Process
impl Send for Process
impl Sync for Process
impl Unpin for Process
impl UnsafeUnpin for Process
impl UnwindSafe for Process
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
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