pub struct BorrowedChildName { /* private fields */ }
Expand description
Like ChildName
, except it holds a string slice rather than an allocated string. For
example, the [Moniker
] API uses this to return path segments without making an allocation.
Implementations§
Source§impl BorrowedChildName
impl BorrowedChildName
Sourcepub fn parse<S: AsRef<str> + ?Sized>(s: &S) -> Result<&Self, MonikerError>
pub fn parse<S: AsRef<str> + ?Sized>(s: &S) -> 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) -> &BorrowedLongName
pub fn collection(&self) -> Option<&BorrowedName>
Trait Implementations§
Source§impl AsRef<BorrowedChildName> for ChildName
impl AsRef<BorrowedChildName> for ChildName
Source§fn as_ref(&self) -> &BorrowedChildName
fn as_ref(&self) -> &BorrowedChildName
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<str> for BorrowedChildName
impl AsRef<str> for BorrowedChildName
Source§impl Borrow<BorrowedChildName> for ChildName
impl Borrow<BorrowedChildName> for ChildName
Source§fn borrow(&self) -> &BorrowedChildName
fn borrow(&self) -> &BorrowedChildName
Immutably borrows from an owned value. Read more
Source§impl Borrow<str> for &BorrowedChildName
impl Borrow<str> for &BorrowedChildName
Source§impl Borrow<str> for BorrowedChildName
impl Borrow<str> for BorrowedChildName
Source§impl Debug for BorrowedChildName
impl Debug for BorrowedChildName
Source§impl Display for BorrowedChildName
impl Display for BorrowedChildName
Source§impl From<&BorrowedChildName> for ChildName
impl From<&BorrowedChildName> for ChildName
Source§fn from(o: &BorrowedChildName) -> Self
fn from(o: &BorrowedChildName) -> Self
Converts to this type from the input type.
Source§impl From<&BorrowedChildName> for ChildRef
impl From<&BorrowedChildName> for ChildRef
Source§fn from(child_name: &BorrowedChildName) -> Self
fn from(child_name: &BorrowedChildName) -> Self
Converts to this type from the input type.