pub struct JobState {
pub job_id: String,
pub pid: u32,
pub log_path: PathBuf,
pub exit_code: Option<i32>,
pub status: JobStatus,
pub state_reason: Option<String>,
pub start_time: SystemTime,
pub completed_at: Option<SystemTime>,
pub command: String,
pub connection_id: String,
}Expand description
Local representation of a background job running on a remote host.
Fields§
§job_id: StringUnique job id returned to callers.
pid: u32Remote process id.
log_path: PathBufLocal log path (spooled on the MCP server host).
exit_code: Option<i32>Exit code captured when the remote process completes.
status: JobStatusCurrent status.
state_reason: Option<String>Why the state became untrustworthy, if applicable.
start_time: SystemTimeWhen job execution started.
completed_at: Option<SystemTime>When job execution completed (if terminal).
command: StringOriginal command string.
connection_id: StringOpaque connection identifier (resolved by an external manager).
Implementations§
Source§impl JobState
impl JobState
pub fn new_running(opts: NewRunningJob) -> Self
pub fn is_terminal(&self) -> bool
pub fn elapsed_time(&self) -> String
pub fn mark_exit(&mut self, exit_code: i32)
pub fn mark_state_lost(&mut self, reason: impl Into<String>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JobState
impl RefUnwindSafe for JobState
impl Send for JobState
impl Sync for JobState
impl Unpin for JobState
impl UnsafeUnpin for JobState
impl UnwindSafe for JobState
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