pub struct Process {
pub uuid: Uuid,
pub config: Runner,
pub pid: Option<i32>,
pub ppid: Option<i32>,
pub gid: Option<i32>,
pub sid: Option<i32>,
pub state: State,
pub io: Io,
pub cwd: Option<String>,
}Expand description
A struct that stores the process attributes for further access and manipulation.
Example:
let proc = Process::new()
.stdin("ls -al")
.fs()
.run()?;
let stdout = proc.io.stdout;
let stderr = proc.io.stderr;
Fields§
§uuid: Uuid§config: Runner§pid: Option<i32>§ppid: Option<i32>§gid: Option<i32>§sid: Option<i32>§state: State§io: Io§cwd: Option<String>Implementations§
Source§impl Process
impl Process
pub fn stdin(&mut self, stdin: &str) -> &mut Self
pub fn term(&mut self) -> &mut Self
pub fn background(&mut self) -> &mut Self
pub fn detach(&mut self) -> &mut Self
Sourcepub fn soft_detach(&mut self) -> &mut Self
pub fn soft_detach(&mut self) -> &mut Self
Detach child process from parent but keep in process group. Killing parent won’t kill child but killing parent group will.
Sourcepub fn orphan(&mut self) -> &mut Self
pub fn orphan(&mut self) -> &mut Self
Detach child process from parent and remove from process group Neither killing parent or parent group will kill the child.
Must be root to create an orphan process.
pub fn fs(&mut self) -> &mut Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Process
impl<'de> Deserialize<'de> for Process
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Process> for Process
Convert a rustix::Process struct into a pipelight::Process struct
impl From<&Process> for Process
Convert a rustix::Process struct into a pipelight::Process struct
Source§impl Statuable for Process
Implementation of the Statuable trait for the process struct.
impl Statuable for Process
Implementation of the Statuable trait for the process struct.
fn get_status(&self) -> Option<Status>
fn set_status(&mut self, status: Option<Status>)
impl Eq for Process
impl StructuralPartialEq for Process
Auto Trait Implementations§
impl Freeze for Process
impl RefUnwindSafe for Process
impl Send for Process
impl Sync for Process
impl Unpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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