Module async_rustbus::rustbus_core::path[][src]

Expand description

Structs for validating, marshalling and unmarshalling DBus object paths.

ObjectPath and ObjectPathBuf are based on Path and PathBuf from std::path respectively. Most of the same methods are implemented with minor semantic differences. These differences arise because all valid ObjectPaths are absolute. See each method for details. ObjectPath implements Deref for Path allowing it to be easily used in context requring a standard library path. Also because all ObjectPaths are valid Rust strs, there are easy methods to convert them to &strs.

ObjectPaths are subsets of strs and Paths and can be created from them if they meet the rules detailed in the section below. These methods can also be used to simpily validate strs or Paths.

Restrictions on valid DBus object paths

  • All DBus object paths are absolute. They always start with a /.
  • Each element in the path are seperated by /. These elements can contain the ASCII characters [A-Z][a-z][0-9]_.
  • There cannot be consecutive / seperators. In otherwords, each element must be a non-zero length.
  • The last character cannot be a / seperator, unless the path is a root path (a single /).

The relevant portion of the DBus Specification can be found here.

Structs

A slice of a Dbus object path akin to a str or std::path::Path.

Enums

Error type enumerating typical ways a standard path may be an invalid object path.