pub struct ShortGitOid(/* private fields */);Expand description
A short object identifier prefix.
Implementations§
Source§impl ShortGitOid
impl ShortGitOid
Sourcepub fn new(value: impl AsRef<str>) -> Result<ShortGitOid, GitOidParseError>
pub fn new(value: impl AsRef<str>) -> Result<ShortGitOid, GitOidParseError>
Creates a short object identifier prefix from hexadecimal text.
§Errors
Returns GitOidParseError when the text is empty, too short, too long,
or contains non-hexadecimal characters.
Sourcepub const fn kind_hint(&self) -> Option<GitOidKind>
pub const fn kind_hint(&self) -> Option<GitOidKind>
Returns the best known object identifier kind from the prefix length.
Trait Implementations§
Source§impl AsRef<str> for ShortGitOid
impl AsRef<str> for ShortGitOid
Source§impl Clone for ShortGitOid
impl Clone for ShortGitOid
Source§fn clone(&self) -> ShortGitOid
fn clone(&self) -> ShortGitOid
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 ShortGitOid
impl Debug for ShortGitOid
Source§impl Display for ShortGitOid
impl Display for ShortGitOid
Source§impl FromStr for ShortGitOid
impl FromStr for ShortGitOid
Source§type Err = GitOidParseError
type Err = GitOidParseError
The associated error which can be returned from parsing.
Source§fn from_str(value: &str) -> Result<ShortGitOid, <ShortGitOid as FromStr>::Err>
fn from_str(value: &str) -> Result<ShortGitOid, <ShortGitOid as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for ShortGitOid
impl Hash for ShortGitOid
Source§impl Ord for ShortGitOid
impl Ord for ShortGitOid
Source§fn cmp(&self, other: &ShortGitOid) -> Ordering
fn cmp(&self, other: &ShortGitOid) -> 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 ShortGitOid
impl PartialEq for ShortGitOid
Source§fn eq(&self, other: &ShortGitOid) -> bool
fn eq(&self, other: &ShortGitOid) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ShortGitOid
impl PartialOrd for ShortGitOid
Source§impl TryFrom<&str> for ShortGitOid
impl TryFrom<&str> for ShortGitOid
Source§type Error = GitOidParseError
type Error = GitOidParseError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &str,
) -> Result<ShortGitOid, <ShortGitOid as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<ShortGitOid, <ShortGitOid as TryFrom<&str>>::Error>
Performs the conversion.
impl Eq for ShortGitOid
impl StructuralPartialEq for ShortGitOid
Auto Trait Implementations§
impl Freeze for ShortGitOid
impl RefUnwindSafe for ShortGitOid
impl Send for ShortGitOid
impl Sync for ShortGitOid
impl Unpin for ShortGitOid
impl UnsafeUnpin for ShortGitOid
impl UnwindSafe for ShortGitOid
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