pub struct Process { /* private fields */ }
Available on crate feature
process
only.Expand description
A Windows process.
Implementations§
Source§impl Process
impl Process
Sourcepub fn current() -> Self
pub fn current() -> Self
Constructs a special handle that always points to the current process.
When transferred to a different process, it will point to that process when used from it.
Sourcepub fn from_id<I>(id: I) -> Result<Self>
pub fn from_id<I>(id: I) -> Result<Self>
Tries to acquire a process handle from an ID.
This may fail due to insufficient access rights.
Sourcepub fn begin_background_mode() -> Result<()>
pub fn begin_background_mode() -> Result<()>
Sets the current process to background processing mode.
This will also lower the I/O priority of the process, which will lower the impact of heavy disk I/O on other processes.
Sourcepub fn end_background_mode() -> Result<()>
pub fn end_background_mode() -> Result<()>
Ends background processing mode for the current process.
Sourcepub fn set_priority(&mut self, priority: ProcessPriority) -> Result<()>
pub fn set_priority(&mut self, priority: ProcessPriority) -> Result<()>
Sets the priority of the process.
§Examples
use winapi_easy::process::{Process, ProcessPriority};
Process::current().set_priority(ProcessPriority::Normal)?;
Sourcepub fn get_io_priority(&self) -> Result<Option<IoPriority>>
pub fn get_io_priority(&self) -> Result<Option<IoPriority>>
Returns the I/O priority of the process.
Will return None
if it is an unknown value.
pub fn set_io_priority(&mut self, io_priority: IoPriority) -> Result<()>
pub fn get_id(&self) -> ProcessId
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