pub struct ChildName {
pub name: LongName,
pub collection: Option<Name>,
}
Expand description
A ChildName locally identifies a child component instance using the name assigned by its parent and its collection (if present). It is the building block of [Moniker].
Display notation: “[collection:]name”.
Fields§
§name: LongName
§collection: Option<Name>
Implementations§
Source§impl ChildName
impl ChildName
pub fn new(name: LongName, collection: Option<Name>) -> Self
pub fn try_new<S>(name: S, collection: Option<S>) -> Result<Self, MonikerError>
Sourcepub fn parse<T: AsRef<str>>(rep: T) -> Result<Self, MonikerError>
pub fn parse<T: AsRef<str>>(rep: T) -> Result<Self, MonikerError>
Parses a ChildName
from a string.
Input strings should be of the format [collection:]name
, e.g. foo
or biz:foo
.
pub fn name(&self) -> &LongName
pub fn collection(&self) -> Option<&Name>
Trait Implementations§
Source§impl Ord for ChildName
impl Ord for ChildName
Source§impl PartialOrd for ChildName
impl PartialOrd for ChildName
Source§impl TryFrom<&str> for ChildName
impl TryFrom<&str> for ChildName
Source§type Error = MonikerError
type Error = MonikerError
The type returned in the event of a conversion error.
impl Eq for ChildName
impl StructuralPartialEq for ChildName
Auto Trait Implementations§
impl Freeze for ChildName
impl RefUnwindSafe for ChildName
impl Send for ChildName
impl Sync for ChildName
impl Unpin for ChildName
impl UnwindSafe for ChildName
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)