pub struct Scheduler { /* private fields */ }
Expand description
Scheduler represents the scheduling attributes for a process. It is based on the Linux sched_setattr(2) syscall.
Implementations§
Source§impl Scheduler
impl Scheduler
Sourcepub fn policy(&self) -> &LinuxSchedulerPolicy
pub fn policy(&self) -> &LinuxSchedulerPolicy
Policy represents the scheduling policy (e.g., SCHED_FIFO, SCHED_RR, SCHED_OTHER).
Sourcepub fn nice(&self) -> &Option<i32>
pub fn nice(&self) -> &Option<i32>
Nice is the nice value for the process, which affects its priority.
Sourcepub fn flags(&self) -> &Option<Vec<LinuxSchedulerFlag>>
pub fn flags(&self) -> &Option<Vec<LinuxSchedulerFlag>>
Flags is an array of scheduling flags.
Sourcepub fn runtime(&self) -> &Option<u64>
pub fn runtime(&self) -> &Option<u64>
Runtime is the amount of time in nanoseconds during which the process is allowed to run in a given period.
Source§impl Scheduler
impl Scheduler
Sourcepub fn set_policy(&mut self, val: LinuxSchedulerPolicy) -> &mut Self
pub fn set_policy(&mut self, val: LinuxSchedulerPolicy) -> &mut Self
Policy represents the scheduling policy (e.g., SCHED_FIFO, SCHED_RR, SCHED_OTHER).
Sourcepub fn set_nice(&mut self, val: Option<i32>) -> &mut Self
pub fn set_nice(&mut self, val: Option<i32>) -> &mut Self
Nice is the nice value for the process, which affects its priority.
Sourcepub fn set_priority(&mut self, val: Option<i32>) -> &mut Self
pub fn set_priority(&mut self, val: Option<i32>) -> &mut Self
Priority represents the static priority of the process.
Sourcepub fn set_flags(&mut self, val: Option<Vec<LinuxSchedulerFlag>>) -> &mut Self
pub fn set_flags(&mut self, val: Option<Vec<LinuxSchedulerFlag>>) -> &mut Self
Flags is an array of scheduling flags.
Sourcepub fn set_runtime(&mut self, val: Option<u64>) -> &mut Self
pub fn set_runtime(&mut self, val: Option<u64>) -> &mut Self
Runtime is the amount of time in nanoseconds during which the process is allowed to run in a given period.
Sourcepub fn set_deadline(&mut self, val: Option<u64>) -> &mut Self
pub fn set_deadline(&mut self, val: Option<u64>) -> &mut Self
Deadline is the absolute deadline for the process to complete its execution.
Sourcepub fn set_period(&mut self, val: Option<u64>) -> &mut Self
pub fn set_period(&mut self, val: Option<u64>) -> &mut Self
Period is the length of the period in nanoseconds used for determining the process runtime.