Skip to main content

RefNameRef

Struct RefNameRef 

Source
pub struct RefNameRef(/* private fields */);
Expand description

Borrowed validated ref name (like std::path::Path to std::path::PathBuf).

Implementations§

Source§

impl RefNameRef

Source

pub fn parse<'a>( name: &'a str, policy: &RefNamePolicy, ) -> Result<&'a Self, RefNameError>

Parse name in place when validation does not require owning a normalized copy.

§Errors

Returns RefNameError::NormalizationRequired when policy enables normalization and the normalized form differs from name. Use RefName::parse in that case.

Source

pub fn as_str(&self) -> &str

Borrow the validated ref name as UTF-8.

Source

pub fn from_trusted(s: &str) -> &Self

Borrow a name read from ref storage without re-validating.

Trait Implementations§

Source§

impl AsRef<RefNameRef> for str

Source§

fn as_ref(&self) -> &RefNameRef

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

impl AsRef<RefNameRef> for String

Source§

fn as_ref(&self) -> &RefNameRef

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

impl AsRef<RefNameRef> for RefNameRef

Source§

fn as_ref(&self) -> &RefNameRef

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

impl AsRef<RefNameRef> for RefName

Source§

fn as_ref(&self) -> &RefNameRef

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

impl Borrow<RefNameRef> for RefName

Source§

fn borrow(&self) -> &RefNameRef

Immutably borrows from an owned value. Read more
Source§

impl Display for RefNameRef

Source§

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

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

impl Eq for RefNameRef

Source§

impl Ord for RefNameRef

Source§

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

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

impl PartialEq for RefNameRef

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for RefNameRef

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for RefNameRef

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
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more