Expand description
§Rust D-Bus address parsing
This project provides a Rust library for handling D-Bus addresses following the D-Bus specification.
Server addresses consist of a transport name followed by a colon, and then an optional, comma-separated list of keys and values in the form key=value.
use dbus_addr::DBusAddr;
let addr: DBusAddr = "unix:path=/tmp/dbus.sock".try_into().unwrap();
§Miscellaneous and caveats on D-Bus addresses
-
Assumes values are UTF-8 encoded.
-
Accept duplicated keys, the last one wins.
-
Assumes that empty
key=val
is accepted, sotransport:,,guid=...
is valid. -
Allows key only, so
transport:foo,bar
is ok. -
Accept unknown keys and transports.
§Acknowledgments
-
This project is originated from the zbus project.
-
Special thanks to all the contributors who have been involved in this project.
§License
Modules§
- transport
- D-Bus supported transports.
Structs§
- DBus
Addr - A parsed bus address.
- DBus
Addr List - A bus address list.
- DBus
Addr List Iter - An iterator of D-Bus addresses.
- Guid
- Universally-unique IDs for D-Bus addresses.
- OwnedD
BusAddr - An owned bus address.
- OwnedD
BusAddr List Iter - An iterator of D-Bus addresses.
Enums§
- Error
- Error returned when an address is invalid.
Traits§
- ToDBus
Addrs - A trait for objects which can be converted or resolved to one or more
DBusAddr
values. - ToOwnedD
BusAddrs - A trait for objects which can be converted or resolved to one or more
OwnedDBusAddr
values.
Functions§
- decode_
percents - Percent-decode the string.
- encode_
percents - Percent-encode the value.
- session
- Get the address for session socket respecting the DBUS_SESSION_BUS_ADDRESS environment variable. If we don’t recognize the value (or it’s not set) we fall back to $XDG_RUNTIME_DIR/bus
- system
- Get the address for system bus respecting the DBUS_SYSTEM_BUS_ADDRESS environment variable. If we don’t recognize the value (or it’s not set) we fall back to /var/run/dbus/system_bus_socket