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§

Implementations§

source§

impl RunningState

source

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.

source

pub const fn has_exited(&self) -> bool

source

pub const fn is_alive(&self) -> bool

source

pub const fn reason(&self) -> &Reason

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.