[−][src]Struct git_hash::borrowed::Digest
A borrowed reference to a hash identifying objects.
Implementations
impl<'a> Digest<'a>
[src]
Access
pub fn kind(&self) -> Kind
[src]
The kind of hash used for this Digest
pub fn first_byte(&self) -> u8
[src]
The first byte of the hash, commonly used to partition a set of Digest
s
impl<'a> Digest<'a>
[src]
Sha1 specific methods
pub fn to_sha1_hex(&self) -> [u8; 40]
[src]
Returns an array with a hexadecimal encoded version of the Sha1 hash this Digest
represents.
Panics if this is not a Sha1 hash, as identifiable by Digest::kind()
.
pub fn sha1(&self) -> &[u8; 20]
[src]
Returns the bytes making up the Sha1.
Panics if this is not a Sha1 hash, as identifiable by Digest::kind()
.
pub fn null_sha1() -> Self
[src]
Returns a Sha1 digest with all bytes being initialized to zero.
Trait Implementations
impl<'a> Clone for Digest<'a>
[src]
impl<'a> Copy for Digest<'a>
[src]
impl<'a> Debug for Digest<'a>
[src]
impl<'de: 'a, 'a> Deserialize<'de> for Digest<'a>
[src]
Manually created from a version that uses a slice, and we forcefully try to convert it into a borrowed array of the desired size Could be improved by fitting this into serde Unfortunately the serde::Deserialize derive wouldn't work for borrowed arrays.
pub fn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Display for Digest<'_>
[src]
impl<'a> Eq for Digest<'a>
[src]
impl<'a> From<&'a [u8; 20]> for Digest<'a>
[src]
impl<'a> From<Digest<'a>> for Digest
[src]
impl<'a> Hash for Digest<'a>
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> Ord for Digest<'a>
[src]
pub fn cmp(&self, other: &Digest<'a>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<'a> PartialEq<Digest<'a>> for Digest<'a>
[src]
impl<'a> PartialOrd<Digest<'a>> for Digest<'a>
[src]
pub fn partial_cmp(&self, other: &Digest<'a>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Digest<'a>) -> bool
[src]
pub fn le(&self, other: &Digest<'a>) -> bool
[src]
pub fn gt(&self, other: &Digest<'a>) -> bool
[src]
pub fn ge(&self, other: &Digest<'a>) -> bool
[src]
impl<'a> Serialize for Digest<'a>
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'a> StructuralEq for Digest<'a>
[src]
impl<'a> StructuralPartialEq for Digest<'a>
[src]
impl<'a> TryFrom<&'a [u8]> for Digest<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Digest<'a>
[src]
impl<'a> Send for Digest<'a>
[src]
impl<'a> Sync for Digest<'a>
[src]
impl<'a> Unpin for Digest<'a>
[src]
impl<'a> UnwindSafe for Digest<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,