bluez-generated 0.4.0

Generated async D-Bus bindings for talking to BlueZ on Linux.
Documentation
// This code was autogenerated with `dbus-codegen-rust --file=specs/org.bluez.MediaControl1.xml --interfaces=org.bluez.MediaControl1 --client=nonblock --methodtype=none --prop-newtype`, see https://github.com/diwic/dbus-rs
#[allow(unused_imports)]
use dbus::arg;
use dbus::nonblock;

pub trait OrgBluezMediaControl1 {
    fn connected(&self) -> nonblock::MethodReply<bool>;
    fn player(&self) -> nonblock::MethodReply<dbus::Path<'static>>;
}

pub const ORG_BLUEZ_MEDIA_CONTROL1_NAME: &str = "org.bluez.MediaControl1";

#[derive(Copy, Clone, Debug)]
pub struct OrgBluezMediaControl1Properties<'a>(pub &'a arg::PropMap);

impl<'a> OrgBluezMediaControl1Properties<'a> {
    pub fn from_interfaces(
        interfaces: &'a ::std::collections::HashMap<String, arg::PropMap>,
    ) -> Option<Self> {
        interfaces.get("org.bluez.MediaControl1").map(Self)
    }

    pub fn connected(&self) -> Option<bool> {
        arg::prop_cast(self.0, "Connected").copied()
    }

    pub fn player(&self) -> Option<&dbus::Path<'static>> {
        arg::prop_cast(self.0, "Player")
    }
}

impl<'a, T: nonblock::NonblockReply, C: ::std::ops::Deref<Target = T>> OrgBluezMediaControl1
    for nonblock::Proxy<'a, C>
{
    fn connected(&self) -> nonblock::MethodReply<bool> {
        <Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
            &self,
            "org.bluez.MediaControl1",
            "Connected",
        )
    }

    fn player(&self) -> nonblock::MethodReply<dbus::Path<'static>> {
        <Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
            &self,
            "org.bluez.MediaControl1",
            "Player",
        )
    }
}