pub enum Hash {
None,
Sha512(Sha512),
}
Expand description
The external hash of patches.
Variants§
None
None is the hash of the “null patch”, which introduced a single root vertex at the beginning of the repository.
Sha512(Sha512)
Patch hashed using the SHA2-512 algorithm.
Implementations§
Source§impl Hash
impl Hash
Sourcepub fn from_binary(v: &[u8]) -> Option<Self>
pub fn from_binary(v: &[u8]) -> Option<Self>
Get a Hash
from a binary slice. This function does not
compute the digest of anything, it just converts types.
Sourcepub fn from_base58(base58: &str) -> Option<Self>
pub fn from_base58(base58: &str) -> Option<Self>
Decode a hash from a base58-encoded str
.
Sourcepub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_slice(&self) -> &[u8] ⓘ
This hash as a slice (nonempty iff SHA512). This method might disappear when new hashes are introduced.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
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 Hash
impl Ord for Hash
Source§impl PartialOrd for Hash
impl PartialOrd for Hash
impl Eq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
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