pub struct ProcessPriority { /* private fields */ }Expand description
Re-export of heel’s scheduling priority types for terminal-tool configuration. The scheduling priority of a sandboxed process and its descendants.
Both halves are relative to the host: the CPU level counts steps below the spawning process, and the I/O policy yields to whatever else is running.
The default leaves both the CPU and the I/O priority untouched, which is
also what keeps the faster posix_spawn path available when no other
setting needs a hook between fork and exec.
use heel::{CpuPriority, IoPriority, NiceLevel, ProcessPriority};
let priority = ProcessPriority::new(
CpuPriority::Nice(NiceLevel::new(10)?),
IoPriority::Background,
);
assert!(!priority.is_normal());
assert!(ProcessPriority::default().is_normal());Implementations§
Source§impl ProcessPriority
impl ProcessPriority
Sourcepub const fn new(cpu: CpuPriority, io: IoPriority) -> ProcessPriority
pub const fn new(cpu: CpuPriority, io: IoPriority) -> ProcessPriority
Lower the CPU and the I/O priority together, relative to the host.
Sourcepub const fn cpu(self) -> CpuPriority
pub const fn cpu(self) -> CpuPriority
How much CPU time the process competes for.
Sourcepub const fn io(self) -> IoPriority
pub const fn io(self) -> IoPriority
How much disk bandwidth the process competes for.
Trait Implementations§
Source§impl Clone for ProcessPriority
impl Clone for ProcessPriority
Source§fn clone(&self) -> ProcessPriority
fn clone(&self) -> ProcessPriority
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ProcessPriority
Source§impl Debug for ProcessPriority
impl Debug for ProcessPriority
Source§impl Default for ProcessPriority
impl Default for ProcessPriority
Source§fn default() -> ProcessPriority
fn default() -> ProcessPriority
Returns the “default value” for a type. Read more
impl Eq for ProcessPriority
Source§impl Hash for ProcessPriority
impl Hash for ProcessPriority
Source§impl PartialEq for ProcessPriority
impl PartialEq for ProcessPriority
impl StructuralPartialEq for ProcessPriority
Auto Trait Implementations§
impl Forget for ProcessPriority
impl Freeze for ProcessPriority
impl Move for ProcessPriority
impl RefUnwindSafe for ProcessPriority
impl Send for ProcessPriority
impl Sync for ProcessPriority
impl Unpin for ProcessPriority
impl UnsafeUnpin for ProcessPriority
impl UnwindSafe for ProcessPriority
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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