pub enum GitHashKind {
Sha1,
Sha256,
}Expand description
Which hash a repository’s object ids use. gunnar defaults to sha256 (D11); sha1 stays supported.
Variants§
Implementations§
Source§impl GitHashKind
impl GitHashKind
Sourcepub fn from_hex_len(len: usize) -> Option<Self>
pub fn from_hex_len(len: usize) -> Option<Self>
Infer the hash from a hex oid’s length. None for anything else.
pub fn code(self) -> u8
pub fn from_code(c: u8) -> Option<Self>
Sourcepub fn oid_of(self, canonical_bytes: &[u8]) -> Vec<u8> ⓘ
pub fn oid_of(self, canonical_bytes: &[u8]) -> Vec<u8> ⓘ
The object id of these canonical bytes.
Sourcepub fn oid_of_object(self, kind: GitObjectKind, payload: &[u8]) -> Vec<u8> ⓘ
pub fn oid_of_object(self, kind: GitObjectKind, payload: &[u8]) -> Vec<u8> ⓘ
The object id of (kind, payload) without building the canonical
bytes: the "<type> <len>\0" header and the payload are fed to the
hasher in two updates, so the resolver’s hot path allocates and copies
nothing per object here (LAW: zero copy). Same oid as
oid_of(&canonical(kind, payload)), and oid_of_object_is_oid_of_canonical
holds the two together.
Sourcepub fn oid_hex_of(self, canonical_bytes: &[u8]) -> String
pub fn oid_hex_of(self, canonical_bytes: &[u8]) -> String
The hex object id of these canonical bytes.
Trait Implementations§
Source§impl Clone for GitHashKind
impl Clone for GitHashKind
impl Copy for GitHashKind
Source§impl Debug for GitHashKind
impl Debug for GitHashKind
impl Eq for GitHashKind
Source§impl PartialEq for GitHashKind
impl PartialEq for GitHashKind
impl StructuralPartialEq for GitHashKind
Auto Trait Implementations§
impl Freeze for GitHashKind
impl RefUnwindSafe for GitHashKind
impl Send for GitHashKind
impl Sync for GitHashKind
impl Unpin for GitHashKind
impl UnsafeUnpin for GitHashKind
impl UnwindSafe for GitHashKind
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.