pub struct FullName(_);
Expand description
Indicate that the given BString is a validate reference name or path that can be used as path on disk or written as target of a symbolic reference
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<FullName> for FullName
impl PartialEq<FullName> for FullName
source§impl PartialOrd<FullName> for FullName
impl PartialOrd<FullName> 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 more