pub struct Moniker { /* private fields */ }
Expand description
Moniker describes the identity of a component instance in terms of its path relative to the root of the component instance tree.
Display notation: “.”, “name1”, “name1/name2”, …
Implementations§
Source§impl Moniker
impl Moniker
pub fn new(path: &[ChildName]) -> Self
pub fn path(&self) -> &[ChildName]
pub fn parse<T: AsRef<str>>(path: &[T]) -> Result<Self, MonikerError>
pub fn parse_str(input: &str) -> Result<Self, MonikerError>
Sourcepub fn has_prefix(&self, prefix: &Moniker) -> bool
pub fn has_prefix(&self, prefix: &Moniker) -> bool
Indicates whether this moniker is prefixed by prefix.
pub fn root() -> Self
Sourcepub fn leaf(&self) -> Option<&ChildName>
pub fn leaf(&self) -> Option<&ChildName>
Returns the last child of this moniker if this is not the root moniker.
pub fn is_root(&self) -> bool
Sourcepub fn parent(&self) -> Option<Self>
pub fn parent(&self) -> Option<Self>
Creates a new moniker with the last child removed. Returns None
if this is the root
moniker.
Sourcepub fn child(&self, child: ChildName) -> Self
pub fn child(&self, child: ChildName) -> Self
Creates a new Moniker with child
added to the end of this moniker.
Sourcepub fn split_leaf(&self) -> Option<(Self, ChildName)>
pub fn split_leaf(&self) -> Option<(Self, ChildName)>
Splits off the last child of this moniker returning the parent as a moniker and the child.
Returns None
if this is the root moniker.
Sourcepub fn strip_prefix(&self, prefix: &Moniker) -> Result<Self, MonikerError>
pub fn strip_prefix(&self, prefix: &Moniker) -> Result<Self, MonikerError>
Strips the moniker parts in prefix from the beginning of this moniker.
Trait Implementations§
Source§impl FidlIntoNative<Moniker> for String
impl FidlIntoNative<Moniker> for String
fn fidl_into_native(self) -> Moniker
Source§impl From<Moniker> for ExtendedMoniker
impl From<Moniker> for ExtendedMoniker
Source§impl NativeIntoFidl<String> for Moniker
impl NativeIntoFidl<String> for Moniker
fn native_into_fidl(self) -> String
Source§impl Ord for Moniker
impl Ord for Moniker
Source§impl PartialOrd for Moniker
impl PartialOrd for Moniker
Source§impl TryFrom<&[&str]> for Moniker
impl TryFrom<&[&str]> for Moniker
Source§type Error = MonikerError
type Error = MonikerError
The type returned in the event of a conversion error.
Source§impl TryFrom<&str> for Moniker
impl TryFrom<&str> for Moniker
Source§type Error = MonikerError
type Error = MonikerError
The type returned in the event of a conversion error.
impl Eq for Moniker
impl StructuralPartialEq for Moniker
Auto Trait Implementations§
impl Freeze for Moniker
impl RefUnwindSafe for Moniker
impl Send for Moniker
impl Sync for Moniker
impl Unpin for Moniker
impl UnwindSafe for Moniker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more