Implement Version dbus api with value 1 for now.

This commit is contained in:
Jeremy Whiting 2023-10-02 12:01:43 -06:00
parent aa86fdd810
commit 8f0f6e7976

View file

@ -26,13 +26,20 @@
use zbus_macros::dbus_interface;
use zbus::{ObjectServer, SignalContext, MessageHeader};
pub struct SMManager {
}
#[dbus_interface(name = "com.steampowered.SteamOSManager1")]
impl SMManager {
const API_VERSION: u32 = 1;
async fn say_hello(&self, name: &str) -> String {
format!("Hello {}!", name)
}
/// A version property.
#[dbus_interface(property)]
async fn version(&self) -> u32 {
SMManager::API_VERSION
}
}