dbus_tree/
lib.rs

1//! Contains functionality for dispatching methods on a D-Bus "server".
2//!
3//! # Example
4//! ```rust,no_run
5//! use dbus_tree::Factory;
6//! use dbus::ffidisp::Connection;
7//! let f = Factory::new_fn::<()>();
8//! /* Add a method returning "Thanks!" on interface "com.example.dbus.rs"
9//!    on object path "/example". */
10//! let t = f.tree(()).add(f.object_path("/example", ()).introspectable()
11//!     .add(f.interface("com.example.dbus.rs", ())
12//!         .add_m(f.method("CallMe", (), |m| {
13//!             Ok(vec!(m.msg.method_return().append1("Thanks!"))) }
14//!         ).out_arg("s"))
15//! ));
16//!
17//! let c = Connection::new_session().unwrap();
18//! t.set_registered(&c, true).unwrap();
19//! c.add_handler(t);
20//! /* Run forever */
21//! loop { c.incoming(1000).next(); }
22//! ```
23//!
24//! See `examples/server.rs` and `examples/adv_server.rs` for more thorough examples.
25
26mod utils;
27mod methodtype;
28mod leaves;
29mod objectpath;
30mod factory;
31
32pub use dbus::MethodErr;
33
34pub use self::utils::{Argument, Iter};
35pub use self::methodtype::{MethodInfo, PropInfo, MethodResult, MethodType, DataType, MTFn, MTFnMut, MTSync};
36pub use self::leaves::{Method, Signal, Property, Access, EmitsChangedSignal};
37pub use self::objectpath::{Interface, ObjectPath, Tree, TreeServer};
38pub use self::factory::Factory;