Enum steroid::process::RunningState
source · pub enum RunningState {
Alive(TargetController),
Exited(Reason),
}Expand description
Result of TargetProcess::wait.
This type represents the state of the remote process once the steroid client has waited for it to stop and give back control. A process can either be exited (i.e. not valid anymore) or alive. If a process is still alive, the user is provided with a controller to manipulate the process. Otherwise, they can only access the reason why the process exited.
Variants§
Alive(TargetController)
Exited(Reason)
Implementations§
source§impl RunningState
impl RunningState
sourcepub fn assume_alive(self) -> Result<TargetController, UnexpectedExit>
pub fn assume_alive(self) -> Result<TargetController, UnexpectedExit>
Helper function that allow the user to get the controller of their remote process if they know it must still be running.
let ctrl = process.wait()?.assume_alive()?;Errors
If the user assumes the process to be alive while it is not, a UnexpectedExit is
returned.
pub const fn has_exited(&self) -> bool
pub const fn is_alive(&self) -> bool
pub const fn reason(&self) -> &Reason
Auto Trait Implementations§
impl RefUnwindSafe for RunningState
impl Send for RunningState
impl Sync for RunningState
impl Unpin for RunningState
impl UnwindSafe for RunningState
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