Enum git_repository::index::hash::Kind
source · pub enum Kind {
Sha1,
}
Expand description
Denotes the kind of function to produce a Id
Variants§
Sha1
The Sha1 hash with 160 bits.
Implementations§
source§impl Kind
impl Kind
sourcepub const fn hex_buf() -> [u8; 40]
pub const fn hex_buf() -> [u8; 40]
Returns a buffer suitable to hold the longest possible hash in hex.
sourcepub const fn buf() -> [u8; 20]
pub const fn buf() -> [u8; 20]
Returns a buffer suitable to hold the longest possible hash as raw bytes.
sourcepub const fn len_in_hex(&self) -> usize
pub const fn len_in_hex(&self) -> usize
Returns the amount of ascii-characters needed to encode this has in hex
sourcepub const fn len_in_bytes(&self) -> usize
pub const fn len_in_bytes(&self) -> usize
Returns the amount of bytes taken up by the hash of the current kind
sourcepub const fn from_hex_len(hex_len: usize) -> Option<Kind>
pub const fn from_hex_len(hex_len: usize) -> Option<Kind>
Returns the kind of hash that would fit the given hex_len
, or None
if there is no fitting hash.
Note that 0 as hex_len
fits always yields Sha1.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Kind
impl<'de> Deserialize<'de> for Kind
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Kind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Kind, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Kind
impl Ord for Kind
source§impl PartialEq<Kind> for Kind
impl PartialEq<Kind> for Kind
source§impl PartialOrd<Kind> for Kind
impl PartialOrd<Kind> for Kind
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 moresource§impl Serialize for Kind
impl Serialize for Kind
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Kind
impl Eq for Kind
impl StructuralEq for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnwindSafe for Kind
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere T: Display,
§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString
]. Read more