pub struct RTKit { /* private fields */ }Expand description
The top-level structure providing access to the crate’s functionality.
Implementations§
Source§impl RTKit
impl RTKit
Sourcepub fn new() -> Result<RTKit>
pub fn new() -> Result<RTKit>
Create an instance of the RTKit structure. This makes a connection to the system D-Bus
daemon, and ensures that the rtkit daemon is available.
Returns an RTKit structure if the connection succeeds and the daemon is available, or an
error otherwise.
Sourcepub fn max_realtime_priority(&self) -> Result<i32>
pub fn max_realtime_priority(&self) -> Result<i32>
Returns the maximum permitted real-time priority value.
Sourcepub fn min_nice_level(&self) -> Result<i32>
pub fn min_nice_level(&self) -> Result<i32>
Returns the minimum permitted nice level value.
Sourcepub fn rttime_usec_max(&self) -> Result<i64>
pub fn rttime_usec_max(&self) -> Result<i64>
Returns the maximum time (in microseconds) that may be set for RLIMIT_RTTIME. This is the
maximum time a real-time thread may continuously occupy the CPU before being blocked by a
system call.
Applications must set an RTLIMIT_RTTIME before attempting to request real-time
priority.
Sourcepub fn make_thread_high_priority(
&self,
thread_id: u64,
priority: i32,
) -> Result<()>
pub fn make_thread_high_priority( &self, thread_id: u64, priority: i32, ) -> Result<()>
Requests a nice level of priority for the specified thread id (this is a non-real-time
scheduling level).
Sourcepub fn make_thread_high_priority_with_pid(
&self,
process_id: u64,
thread_id: u64,
priority: i32,
) -> Result<()>
pub fn make_thread_high_priority_with_pid( &self, process_id: u64, thread_id: u64, priority: i32, ) -> Result<()>
Requests a nice level of priority for the specified thread id of a specified process id
(this is a non-real-time scheduling level).
Sourcepub fn make_thread_realtime(&self, thread_id: u64, priority: u32) -> Result<()>
pub fn make_thread_realtime(&self, thread_id: u64, priority: u32) -> Result<()>
Requests a real-time priority of priority for the specified thread id.
Sourcepub fn make_thread_realtime_with_pid(
&self,
process_id: u64,
thread_id: u64,
priority: u32,
) -> Result<()>
pub fn make_thread_realtime_with_pid( &self, process_id: u64, thread_id: u64, priority: u32, ) -> Result<()>
Requests a real-time priority of priority for the specified thread id of a specified
process id.
Sourcepub fn current_thread_id() -> u64
pub fn current_thread_id() -> u64
A convenience method to return the calling thread’s thread id.
Sourcepub fn current_process_id() -> u64
pub fn current_process_id() -> u64
A convenience method to return the current process id.