Struct gix_ref::PartialNameRef

source ·
pub struct PartialNameRef(/* private fields */);
Expand description

A validated and potentially partial reference name, safe to use for common operations.

Implementations§

source§

impl PartialNameRef

source

pub fn to_partial_path(&self) -> &Path

Convert this name into the relative path possibly identifying the reference location. Note that it may be only a partial path though.

source

pub fn as_bstr(&self) -> &BStr

Provide the name as binary string which is known to be a valid partial ref name.

Trait Implementations§

source§

impl AsRef<PartialNameRef> for PartialName

source§

fn as_ref(&self) -> &PartialNameRef

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<PartialNameRef> for PartialName

source§

fn borrow(&self) -> &PartialNameRef

Immutably borrows from an owned value. Read more
source§

impl Debug for PartialNameRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a FullNameRef> for &'a PartialNameRef

source§

fn from(v: &'a FullNameRef) -> Self

Converts to this type from the input type.
source§

impl Hash for PartialNameRef

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
source§

impl Ord for PartialNameRef

source§

fn cmp(&self, other: &PartialNameRef) -> Ordering

This method returns an Ordering between self and other. Read more
source§

impl PartialEq for PartialNameRef

source§

fn eq(&self, other: &PartialNameRef) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PartialNameRef

source§

fn partial_cmp(&self, other: &PartialNameRef) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl ToOwned for PartialNameRef

§

type Owned = PartialName

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<'a> TryFrom<&'a BStr> for &'a PartialNameRef

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(v: &'a BStr) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a BString> for &'a PartialNameRef

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(v: &'a BString) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a FullName> for &'a PartialNameRef

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(v: &'a FullName) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a OsStr> for &'a PartialNameRef

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(v: &'a OsStr) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a PartialName> for &'a PartialNameRef

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(v: &'a PartialName) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a String> for &'a PartialNameRef

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(v: &'a String) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a str> for &'a PartialNameRef

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(v: &'a str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for PartialNameRef

source§

impl StructuralPartialEq for PartialNameRef

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more