pub struct Process { /* private fields */ }Expand description
Represent a process in a POSIX system.
Implementations§
Source§impl Process
impl Process
Sourcepub fn from_pid(pid: ProcessId) -> Process
pub fn from_pid(pid: ProcessId) -> Process
Creates a process from a provided id. The process does not have to exists at the time of creation. But all other methods may fail when the process does not exist.
Sourcepub fn from_parent() -> Process
pub fn from_parent() -> Process
Create a process object from the parents process.
Sourcepub fn executable(&self) -> Result<FilePath, ProcessExecutablePathError>
pub fn executable(&self) -> Result<FilePath, ProcessExecutablePathError>
Returns the executable path of the Process.
Sourcepub fn send_signal(&self, signal: Signal) -> Result<(), ProcessSendSignalError>
pub fn send_signal(&self, signal: Signal) -> Result<(), ProcessSendSignalError>
Sends a signal to the process.
Sourcepub fn get_priority(&self) -> Result<u8, ProcessGetSchedulerError>
pub fn get_priority(&self) -> Result<u8, ProcessGetSchedulerError>
Returns the priority of the process. 0 is the lowest and 255 the highest priority.
Sourcepub fn set_priority(
&mut self,
priority: u8,
) -> Result<(), ProcessGetSchedulerError>
pub fn set_priority( &mut self, priority: u8, ) -> Result<(), ProcessGetSchedulerError>
Set the priority of the process. 0 is the lowest priority and 255 the highest.
Sourcepub fn get_scheduler(&self) -> Result<Scheduler, ProcessGetSchedulerError>
pub fn get_scheduler(&self) -> Result<Scheduler, ProcessGetSchedulerError>
Returns the currently in use Scheduler by the process.
Sourcepub fn set_scheduler(
&mut self,
scheduler: Scheduler,
) -> Result<Scheduler, ProcessSetSchedulerError>
pub fn set_scheduler( &mut self, scheduler: Scheduler, ) -> Result<Scheduler, ProcessSetSchedulerError>
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 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