pub struct GitRefName { /* private fields */ }Expand description
A validated ref name.
Implementations§
Source§impl GitRefName
impl GitRefName
Sourcepub fn new(value: impl AsRef<str>) -> Result<GitRefName, GitRefParseError>
pub fn new(value: impl AsRef<str>) -> Result<GitRefName, GitRefParseError>
Creates a ref name from text.
§Errors
Returns GitRefParseError when the name is empty or uses rejected syntax.
Sourcepub const fn kind(&self) -> GitRefKind
pub const fn kind(&self) -> GitRefKind
Returns the broad ref kind.
Trait Implementations§
Source§impl AsRef<str> for GitRefName
impl AsRef<str> for GitRefName
Source§impl Clone for GitRefName
impl Clone for GitRefName
Source§fn clone(&self) -> GitRefName
fn clone(&self) -> GitRefName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GitRefName
impl Debug for GitRefName
Source§impl Display for GitRefName
impl Display for GitRefName
Source§impl FromStr for GitRefName
impl FromStr for GitRefName
Source§type Err = GitRefParseError
type Err = GitRefParseError
The associated error which can be returned from parsing.
Source§fn from_str(value: &str) -> Result<GitRefName, <GitRefName as FromStr>::Err>
fn from_str(value: &str) -> Result<GitRefName, <GitRefName as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for GitRefName
impl Hash for GitRefName
Source§impl Ord for GitRefName
impl Ord for GitRefName
Source§fn cmp(&self, other: &GitRefName) -> Ordering
fn cmp(&self, other: &GitRefName) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GitRefName
impl PartialEq for GitRefName
Source§fn eq(&self, other: &GitRefName) -> bool
fn eq(&self, other: &GitRefName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GitRefName
impl PartialOrd for GitRefName
Source§impl TryFrom<&str> for GitRefName
impl TryFrom<&str> for GitRefName
Source§type Error = GitRefParseError
type Error = GitRefParseError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &str,
) -> Result<GitRefName, <GitRefName as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<GitRefName, <GitRefName as TryFrom<&str>>::Error>
Performs the conversion.
impl Eq for GitRefName
impl StructuralPartialEq for GitRefName
Auto Trait Implementations§
impl Freeze for GitRefName
impl RefUnwindSafe for GitRefName
impl Send for GitRefName
impl Sync for GitRefName
impl Unpin for GitRefName
impl UnsafeUnpin for GitRefName
impl UnwindSafe for GitRefName
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