rtkit_client_rs/
low_level_zbus_api.rs

1use zbus::{fdo::Result, proxy};
2
3/// Low level interface to the RealtimeKit1 D-Bus service.
4///
5/// Note: due to a missing implementation of GetAll in the canonical rtkit service,
6/// you will need to disable the cache for properties in order not to trigger an UnknownMethod error.
7#[proxy(
8    interface = "org.freedesktop.RealtimeKit1",
9    default_service = "org.freedesktop.RealtimeKit1",
10    default_path = "/org/freedesktop/RealtimeKit1"
11)]
12pub trait RTKit {
13    fn make_thread_realtime(&self, thread: u64, priority: u32) -> Result<()>;
14    fn make_thread_realtime_with_pid(&self, process: u64, thread: u64, priority: u32)
15    -> Result<()>;
16
17    // NOTE: despite being named "priority", the priority parameter here is actually a nice level.
18    fn make_thread_high_priority(&self, thread: u64, priority: i32) -> Result<()>;
19    fn make_thread_high_priority_with_pid(
20        &self,
21        process: u64,
22        thread: u64,
23        priority: i32,
24    ) -> Result<()>;
25
26    fn reset_known(&self) -> Result<()>;
27    fn reset_all(&self) -> Result<()>;
28    fn exit(&self) -> Result<()>;
29
30    #[zbus(property)]
31    fn rt_time_usec_max(&self) -> Result<i64>;
32
33    #[zbus(property)]
34    fn max_realtime_priority(&self) -> Result<i32>;
35
36    #[zbus(property)]
37    fn min_nice_level(&self) -> Result<i32>;
38}