Struct zbus_names::UniqueName [−][src]
pub struct UniqueName<'name>(_);
Expand description
String that identifies a unique bus name.
Examples
use core::convert::TryFrom; use zbus_names::UniqueName; // Valid unique names. let name = UniqueName::try_from(":org.gnome.Service-for_you").unwrap(); assert_eq!(name, ":org.gnome.Service-for_you"); let name = UniqueName::try_from(":a.very.loooooooooooooooooo-ooooooo_0000o0ng.Name").unwrap(); assert_eq!(name, ":a.very.loooooooooooooooooo-ooooooo_0000o0ng.Name"); // Invalid unique names UniqueName::try_from("").unwrap_err(); UniqueName::try_from("dont.start.with.a.colon").unwrap_err(); UniqueName::try_from(":double..dots").unwrap_err(); UniqueName::try_from(".").unwrap_err(); UniqueName::try_from(".start.with.dot").unwrap_err(); UniqueName::try_from(":no-dots").unwrap_err();
Implementations
Create a new UniqueName
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
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.
The none-equivalent value.
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 UniqueName
from a string.
This never succeeds but is provided so it’s easier to pass Option::None
values for API
requiring Option<TryInto<impl BusName>>
, since type inference won’t work here.
Auto Trait Implementations
impl<'name> RefUnwindSafe for UniqueName<'name>
impl<'name> Send for UniqueName<'name>
impl<'name> Sync for UniqueName<'name>
impl<'name> Unpin for UniqueName<'name>
impl<'name> UnwindSafe for UniqueName<'name>
Blanket Implementations
Mutably borrows from an owned value. Read more