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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scheduler
impl<'de> Deserialize<'de> for Scheduler
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>,
impl Eq for Scheduler
impl StructuralPartialEq for Scheduler
Auto Trait Implementations§
impl Freeze for Scheduler
impl RefUnwindSafe for Scheduler
impl Send for Scheduler
impl Sync for Scheduler
impl Unpin for Scheduler
impl UnwindSafe for Scheduler
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)