bluez_generated/
gattservice1.rs

1// This code was autogenerated with `dbus-codegen-rust --file=specs/org.bluez.GattService1.xml --interfaces=org.bluez.GattService1 --client=nonblock --methodtype=none --prop-newtype`, see https://github.com/diwic/dbus-rs
2#[allow(unused_imports)]
3use dbus::arg;
4use dbus::nonblock;
5
6pub trait OrgBluezGattService1 {
7    fn uuid(&self) -> nonblock::MethodReply<String>;
8    fn device(&self) -> nonblock::MethodReply<dbus::Path<'static>>;
9    fn primary(&self) -> nonblock::MethodReply<bool>;
10    fn includes(&self) -> nonblock::MethodReply<Vec<dbus::Path<'static>>>;
11}
12
13pub const ORG_BLUEZ_GATT_SERVICE1_NAME: &str = "org.bluez.GattService1";
14
15#[derive(Copy, Clone, Debug)]
16pub struct OrgBluezGattService1Properties<'a>(pub &'a arg::PropMap);
17
18impl<'a> OrgBluezGattService1Properties<'a> {
19    pub fn from_interfaces(
20        interfaces: &'a ::std::collections::HashMap<String, arg::PropMap>,
21    ) -> Option<Self> {
22        interfaces.get("org.bluez.GattService1").map(Self)
23    }
24
25    pub fn uuid(&self) -> Option<&String> {
26        arg::prop_cast(self.0, "UUID")
27    }
28
29    pub fn device(&self) -> Option<&dbus::Path<'static>> {
30        arg::prop_cast(self.0, "Device")
31    }
32
33    pub fn primary(&self) -> Option<bool> {
34        arg::prop_cast(self.0, "Primary").copied()
35    }
36
37    pub fn includes(&self) -> Option<&Vec<dbus::Path<'static>>> {
38        arg::prop_cast(self.0, "Includes")
39    }
40}
41
42impl<'a, T: nonblock::NonblockReply, C: ::std::ops::Deref<Target = T>> OrgBluezGattService1
43    for nonblock::Proxy<'a, C>
44{
45    fn uuid(&self) -> nonblock::MethodReply<String> {
46        <Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
47            &self,
48            "org.bluez.GattService1",
49            "UUID",
50        )
51    }
52
53    fn device(&self) -> nonblock::MethodReply<dbus::Path<'static>> {
54        <Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
55            &self,
56            "org.bluez.GattService1",
57            "Device",
58        )
59    }
60
61    fn primary(&self) -> nonblock::MethodReply<bool> {
62        <Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
63            &self,
64            "org.bluez.GattService1",
65            "Primary",
66        )
67    }
68
69    fn includes(&self) -> nonblock::MethodReply<Vec<dbus::Path<'static>>> {
70        <Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
71            &self,
72            "org.bluez.GattService1",
73            "Includes",
74        )
75    }
76}