#[repr(transparent)]pub struct Hash(/* private fields */);
Expand description
The key to a git object
Example: dcf3cb0c8270c187003d84fd359e5bb3904fe42a
.
Implementations§
source§impl Hash
impl Hash
pub fn new(bytes: [u8; 20]) -> Self
pub fn zero() -> Self
pub fn is_zero(&self) -> bool
sourcepub fn from_hex(hex: &str) -> Option<Self>
pub fn from_hex(hex: &str) -> Option<Self>
Tries to parse a string into a hash.
The string must be 40-characters long and only contain hexadecimal digits.
pub fn to_bytes(&self) -> [u8; 20]
Trait Implementations§
source§impl Ord for Hash
impl Ord for Hash
source§impl PartialEq<Hash> for Hash
impl PartialEq<Hash> for Hash
source§impl PartialOrd<Hash> for Hash
impl PartialOrd<Hash> for Hash
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Hash
impl Eq for Hash
impl StructuralEq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
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