pub struct RefNameRef(/* private fields */);Expand description
Borrowed validated ref name (like std::path::Path to std::path::PathBuf).
Implementations§
Source§impl RefNameRef
impl RefNameRef
Sourcepub fn parse<'a>(
name: &'a str,
policy: &RefNamePolicy,
) -> Result<&'a Self, RefNameError>
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.
Sourcepub fn from_trusted(s: &str) -> &Self
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
impl AsRef<RefNameRef> for str
Source§fn as_ref(&self) -> &RefNameRef
fn as_ref(&self) -> &RefNameRef
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<RefNameRef> for String
impl AsRef<RefNameRef> for String
Source§fn as_ref(&self) -> &RefNameRef
fn as_ref(&self) -> &RefNameRef
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<RefNameRef> for RefNameRef
impl AsRef<RefNameRef> for RefNameRef
Source§fn as_ref(&self) -> &RefNameRef
fn as_ref(&self) -> &RefNameRef
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<RefNameRef> for RefName
impl AsRef<RefNameRef> for RefName
Source§fn as_ref(&self) -> &RefNameRef
fn as_ref(&self) -> &RefNameRef
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<RefNameRef> for RefName
impl Borrow<RefNameRef> for RefName
Source§fn borrow(&self) -> &RefNameRef
fn borrow(&self) -> &RefNameRef
Immutably borrows from an owned value. Read more
Source§impl Display for RefNameRef
impl Display for RefNameRef
impl Eq for RefNameRef
Source§impl Ord for RefNameRef
impl Ord for RefNameRef
Source§impl PartialEq for RefNameRef
impl PartialEq for RefNameRef
Source§impl PartialOrd for RefNameRef
impl PartialOrd for RefNameRef
impl StructuralPartialEq for RefNameRef
Auto Trait Implementations§
impl !Sized for RefNameRef
impl Forget for RefNameRef
impl Freeze for RefNameRef
impl RefUnwindSafe for RefNameRef
impl Send for RefNameRef
impl Sync for RefNameRef
impl Unpin for RefNameRef
impl UnsafeUnpin for RefNameRef
impl UnwindSafe for RefNameRef
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
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.