Enum libpijul_compat::Hash
source · 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<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 more