Module dbus::tree
[−]
[src]
Contains functionality for dispatching methods on a D-Bus "server".
Supersedes the obj
module. Properties are somewhat still WIP,
but should in any case be better than obj
already.
Example
use dbus::{tree, Connection, BusType}; let f = tree::Factory::new_fn(); /* Add a method returning "Thanks!" on interface "com.example.dbus.rs" on object path "/example". */ let t = f.tree().add(f.object_path("/example").introspectable() .add(f.interface("com.example.dbus.rs") .add_m(f.method("CallMe", |m,_,_| { Ok(vec!(m.method_return().append("Thanks!"))) } ).out_arg("s")) )); let c = Connection::get_private(BusType::Session).unwrap(); t.set_registered(&c, true).unwrap(); /* Run forever */ // for _ in t.run(&c, c.iter(1000)) {}
Structs
Argument |
A D-Bus Argument. |
Factory |
The factory is used to create object paths, interfaces, methods etc. |
Interface |
Represents a D-Bus interface. |
Method |
A D-Bus Method. |
MethodErr |
A D-Bus Method Error. |
MethodFn |
A MethodType that wraps an Fn function |
MethodFnMut |
A MethodType that wraps an FnMut function. Calling this recursively will cause a refcell panic. |
MethodSync |
A MethodType that wraps an Fn+Send+Sync function, so it can be called from several threads in parallel. |
ObjectPath |
A D-Bus Object Path. |
Property |
A D-Bus Property. |
Signal |
A D-Bus Signal. |
Tree |
A collection of object paths. |
TreeServer |
An iterator adapter that handles incoming method calls. |
Enums
Access |
The possible access characteristics a Property can have. |
EmitsChangedSignal |
Enumerates the different signaling behaviors a Property can have to being changed. |
Type Definitions
MethodResult |
Result containing the Messages returned from the Method, or a MethodErr. |