Struct zvariant::ObjectPath [−][src]
pub struct ObjectPath<'a>(_);
Expand description
String that identifies objects at a given destination on the D-Bus bus.
Mostly likely this is only useful in the D-Bus context.
Examples
use core::convert::TryFrom; use zvariant::ObjectPath; // Valid object paths let o = ObjectPath::try_from("/").unwrap(); assert_eq!(o, "/"); let o = ObjectPath::try_from("/Path/t0/0bject").unwrap(); assert_eq!(o, "/Path/t0/0bject"); let o = ObjectPath::try_from("/a/very/looooooooooooooooooooooooo0000o0ng/path").unwrap(); assert_eq!(o, "/a/very/looooooooooooooooooooooooo0000o0ng/path"); // Invalid object paths ObjectPath::try_from("").unwrap_err(); ObjectPath::try_from("/double//slashes/").unwrap_err(); ObjectPath::try_from(".").unwrap_err(); ObjectPath::try_from("/end/with/slash/").unwrap_err(); ObjectPath::try_from("/ha.d").unwrap_err();
Implementations
Create a new ObjectPath
from given bytes.
Since the passed bytes are not checked for correctness, prefer using the
TryFrom<&[u8]>
implementation.
Create a new ObjectPath
from the given string.
Since the passed string is not checked for correctness, prefer using the
TryFrom<&str>
implementation.
Same as from_str_unchecked
, except it takes an owned String
.
Since the passed string is not checked for correctness, prefer using the
TryFrom<String>
implementation.
Creates an owned clone of self
.
Creates an owned clone of self
.
Trait Implementations
The type signature, as a character.
The type signature, as a string.
Please use the alignment
function instead
The required padding alignment.
The required padding alignment for the given format.
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Try to create an ObjectPath from a string.
Auto Trait Implementations
impl<'a> RefUnwindSafe for ObjectPath<'a>
impl<'a> Send for ObjectPath<'a>
impl<'a> Sync for ObjectPath<'a>
impl<'a> Unpin for ObjectPath<'a>
impl<'a> UnwindSafe for ObjectPath<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more