pub struct GitOid { /* private fields */ }Expand description
Unique identity of any Git object (commit, tree, blob, tag).
This type’s FromStr implementation validates that it’s exactly 40 hex characters, i.e. a
full-length git commit.
If Git’s SHA-256 support becomes more widespread in the future (in particular if GitHub ever adds support), we might need to make this an enum.
Implementations§
Source§impl GitOid
impl GitOid
Sourcepub fn as_short_str(&self) -> &str
pub fn as_short_str(&self) -> &str
Return a truncated representation, i.e., the first 16 characters of the SHA.
Sourcepub fn as_tiny_str(&self) -> &str
pub fn as_tiny_str(&self) -> &str
Return a (very) truncated representation, i.e., the first 8 characters of the SHA.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GitOid
impl<'de> Deserialize<'de> for GitOid
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for GitOid
impl Ord for GitOid
Source§impl PartialOrd for GitOid
impl PartialOrd for GitOid
impl Copy for GitOid
impl Eq for GitOid
impl StructuralPartialEq for GitOid
Auto Trait Implementations§
impl Freeze for GitOid
impl RefUnwindSafe for GitOid
impl Send for GitOid
impl Sync for GitOid
impl Unpin for GitOid
impl UnwindSafe for GitOid
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