pub struct FullName(/* private fields */);
Expand description
A validated complete and fully qualified referenced reference name, safe to use for all operations.
Implementations§
source§impl FullName
impl FullName
sourcepub fn to_path(&self) -> &Path
pub fn to_path(&self) -> &Path
Convert this name into the relative path, lossily, identifying the reference location relative to a repository
sourcepub fn into_inner(self) -> BString
pub fn into_inner(self) -> BString
Dissolve this instance and return the buffer.
sourcepub fn prefix_namespace(&mut self, namespace: &Namespace) -> &mut Self
pub fn prefix_namespace(&mut self, namespace: &Namespace) -> &mut Self
Modify ourself so that we use namespace
as prefix, if it is not yet in the namespace
sourcepub fn strip_namespace(&mut self, namespace: &Namespace) -> &mut Self
pub fn strip_namespace(&mut self, namespace: &Namespace) -> &mut Self
Strip the given namespace
off the beginning of this name, if it is in this namespace.
sourcepub fn shorten(&self) -> &BStr
pub fn shorten(&self) -> &BStr
Strip well-known prefixes from the name and return it.
If there is no such prefix, the original name is returned.
sourcepub fn category(&self) -> Option<Category<'_>>
pub fn category(&self) -> Option<Category<'_>>
Classify this name, or return None
if it’s unclassified.
sourcepub fn category_and_short_name(&self) -> Option<(Category<'_>, &BStr)>
pub fn category_and_short_name(&self) -> Option<(Category<'_>, &BStr)>
Classify this name, or return None
if it’s unclassified. If Some
,
the shortened name is returned as well.
Trait Implementations§
source§impl AsRef<FullNameRef> for FullName
impl AsRef<FullNameRef> for FullName
source§fn as_ref(&self) -> &FullNameRef
fn as_ref(&self) -> &FullNameRef
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Borrow<FullNameRef> for FullName
impl Borrow<FullNameRef> for FullName
source§fn borrow(&self) -> &FullNameRef
fn borrow(&self) -> &FullNameRef
Immutably borrows from an owned value. Read more
source§impl<'de> Deserialize<'de> for FullName
impl<'de> Deserialize<'de> for FullName
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> From<&'a FullNameRef> for FullName
impl<'a> From<&'a FullNameRef> for FullName
source§fn from(value: &'a FullNameRef) -> Self
fn from(value: &'a FullNameRef) -> Self
Converts to this type from the input type.
source§impl Ord for FullName
impl Ord for FullName
source§impl PartialEq for FullName
impl PartialEq for FullName
source§impl PartialOrd for FullName
impl PartialOrd for FullName
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'a> TryFrom<&'a FullName> for &'a PartialNameRef
impl<'a> TryFrom<&'a FullName> for &'a PartialNameRef
impl Eq for FullName
impl StructuralEq for FullName
impl StructuralPartialEq for FullName
Auto Trait Implementations§
impl RefUnwindSafe for FullName
impl Send for FullName
impl Sync for FullName
impl Unpin for FullName
impl UnwindSafe for FullName
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