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

The object path as a string.

The object path as bytes.

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.

the object path’s length.

if the object path is empty.

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.

👎 Deprecated since 2.0.2:

Please use the alignment function instead

The required padding alignment.

The required padding alignment for the given format.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Try to create an ObjectPath from a string.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Get the signature for the implementing type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.