Expand description
Runtime support for the code generated by tokio-dbus-codegen.
Where tokio-dbus speaks in borrowed views over a message buffer, this
crate speaks in the owned Rust types a caller would reach for anyway:
String, Vec, HashMap and tuples, with a Value standing in for
a variant. That convenience is paid for with a copy of every message which
crosses the boundary, so reach for the low level API when that matters.
§Examples
use tokio_dbus::{ObjectPath, Signature};
use tokio_dbus_runtime::{Arguments, Connection};
const PATH: &ObjectPath = ObjectPath::new_const(b"/org/freedesktop/DBus");
let mut c = Connection::session_bus().await?;
let mut arguments = Arguments::new(Signature::STRING)?;
arguments.store("org.freedesktop.DBus");
let reply = c
.call(
"org.freedesktop.DBus",
PATH,
"org.freedesktop.DBus",
"GetNameOwner",
&arguments,
)
.await?;
let owner = reply.read::<String>()?;
println!("{owner}");Structs§
- Arguments
- The body of a message being built.
- Call
- An incoming method call.
- Connection
- A connection to a bus which speaks in owned Rust values.
- Error
- An error raised while talking to the bus.
- Name
Owner Changed - The
org.freedesktop.DBus.NameOwnerChangedsignal, which the bus emits when the ownership of a well known name changes. - Reply
- The reply to a method call.
- Signal
Message - An incoming signal.
- Variant
Dict - A writer for an
a{sv}, where every value is a variant of its own type.
Enums§
- Incoming
- A message which arrived on the connection and is not a reply.
- Value
- A D-Bus value whose type is only known at runtime.
Traits§
- Decode
- A Rust value which can be read from a D-Bus message body.
- Encode
- A Rust value which can be written to a D-Bus message body.
Functions§
- decode_
variant - Read a variant which is expected to contain a value of type
T.
Type Aliases§
- Result
- Result alias defaulting to the error type of this crate.