[−][src]Struct zvariant::ObjectPath
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
impl<'a> ObjectPath<'a>
[src]
pub fn as_str(&self) -> &str
[src]
The object path as a string.
pub fn as_bytes(&self) -> &[u8]
[src]
The object path as bytes.
pub fn from_bytes_unchecked<'s: 'a>(bytes: &'s [u8]) -> Self
[src]
Create a new ObjectPath
from given bytes.
Since the passed bytes are not checked for correctness, prefer using the
TryFrom<&[u8]>
implementation.
pub fn from_str_unchecked<'s: 'a>(path: &'s str) -> Self
[src]
Create a new ObjectPath
from the given string.
Since the passed string is not checked for correctness, prefer using the
TryFrom<&str>
implementation.
pub fn from_string_unchecked(path: String) -> Self
[src]
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.
pub fn len(&self) -> usize
[src]
the object path's length.
pub fn is_empty(&self) -> bool
[src]
if the object path is empty.
Trait Implementations
impl<'a> Basic for ObjectPath<'a>
[src]
impl<'a> Clone for ObjectPath<'a>
[src]
fn clone(&self) -> ObjectPath<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for ObjectPath<'a>
[src]
impl<'a> Deref for ObjectPath<'a>
[src]
impl<'de: 'a, 'a> Deserialize<'de> for ObjectPath<'a>
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl<'a> Display for ObjectPath<'a>
[src]
impl<'a> Eq for ObjectPath<'a>
[src]
impl<'a> From<ObjectPath<'a>> for Value<'a>
[src]
fn from(v: ObjectPath<'a>) -> Self
[src]
impl<'a> Hash for ObjectPath<'a>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a, '_> PartialEq<&'_ str> for ObjectPath<'a>
[src]
impl<'a> PartialEq<ObjectPath<'a>> for ObjectPath<'a>
[src]
fn eq(&self, other: &ObjectPath<'a>) -> bool
[src]
fn ne(&self, other: &ObjectPath<'a>) -> bool
[src]
impl<'a> Serialize for ObjectPath<'a>
[src]
impl<'a> StructuralEq for ObjectPath<'a>
[src]
impl<'a> StructuralPartialEq for ObjectPath<'a>
[src]
impl<'a> TryFrom<&'a [u8]> for ObjectPath<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: &'a [u8]) -> Result<Self>
[src]
impl<'a> TryFrom<&'a OwnedValue> for &'a ObjectPath<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(v: &'a OwnedValue) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a Value<'a>> for &'a ObjectPath<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: &'a Value<'a>) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a Value<'a>> for ObjectPath<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: &'a Value) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<&'a str> for ObjectPath<'a>
[src]
Try to create an ObjectPath from a string.
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: &'a str) -> Result<Self>
[src]
impl<'a> TryFrom<OwnedValue> for ObjectPath<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(v: OwnedValue) -> Result<Self, Self::Error>
[src]
impl<'a> TryFrom<String> for ObjectPath<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: String) -> Result<Self>
[src]
impl<'a> TryFrom<Value<'a>> for ObjectPath<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: Value<'a>) -> Result<Self, Self::Error>
[src]
impl<'a> Type for ObjectPath<'a>
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,