[][src]Trait zbus::Interface

pub trait Interface {
    fn name() -> &'static str
    where
        Self: Sized
;
fn get(&self, property_name: &str) -> Option<Result<OwnedValue>>;
fn get_all(&self) -> HashMap<String, OwnedValue>;
fn set(&mut self, property_name: &str, value: &Value) -> Option<Result<()>>;
fn call(
        &self,
        connection: &Connection,
        msg: &Message,
        name: &str
    ) -> Option<Result<u32>>;
fn call_mut(
        &mut self,
        connection: &Connection,
        msg: &Message,
        name: &str
    ) -> Option<Result<u32>>;
fn introspect_to_writer(&self, writer: &mut dyn Write, level: usize); }

The trait used to dispatch messages to an interface instance.

Note: It is not recommended to manually implement this trait. The dbus_interface macro implements it for you.

Required methods

fn name() -> &'static str where
    Self: Sized

Return the name of the interface. Ex: "org.foo.MyInterface"

fn get(&self, property_name: &str) -> Option<Result<OwnedValue>>

Get a property value. Returns None if the property doesn't exist.

fn get_all(&self) -> HashMap<String, OwnedValue>

Return all the properties.

fn set(&mut self, property_name: &str, value: &Value) -> Option<Result<()>>

Set a property value. Returns None if the property doesn't exist.

fn call(
    &self,
    connection: &Connection,
    msg: &Message,
    name: &str
) -> Option<Result<u32>>

Call a &self method. Returns None if the method doesn't exist.

fn call_mut(
    &mut self,
    connection: &Connection,
    msg: &Message,
    name: &str
) -> Option<Result<u32>>

Call a &mut self method. Returns None if the method doesn't exist.

fn introspect_to_writer(&self, writer: &mut dyn Write, level: usize)

Write introspection XML to the writer, with the given indentation level.

Loading content...

Implementors

Loading content...