pub struct OutputHash {
pub mode: OutputHashMode,
pub hash: NixHash,
}Expand description
Represents the information about the hash of a single-output FOD.
We store it in a OutputHashMode and NixHash.
The serde model uses a different format, as we want to emit the same JSON:
There we use hashAlgo and hash:
hashAlgo: optionalr:prefix (for recursive), followed by hash algo identifier (sha1,sha256,sha512,md5)hash: hexlower-encoded digest
Fields§
§mode: OutputHashMode§hash: NixHashImplementations§
Source§impl OutputHash
impl OutputHash
Sourcepub fn from_mode_algo_and_digest(
mode_and_algo: &str,
digest: impl AsRef<[u8]>,
) -> Result<Self, Error>
pub fn from_mode_algo_and_digest( mode_and_algo: &str, digest: impl AsRef<[u8]>, ) -> Result<Self, Error>
Construct from a string containing the algo (with an optional r: prefix), and a digest.
Sourcepub const fn as_mode_and_algo_str(&self) -> &'static str
pub const fn as_mode_and_algo_str(&self) -> &'static str
Returns the OutputHashMode prefix str and the algo, concatenated. This is used in the ATerm representation.
Trait Implementations§
Source§impl Clone for OutputHash
impl Clone for OutputHash
Source§fn clone(&self) -> OutputHash
fn clone(&self) -> OutputHash
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OutputHash
impl Debug for OutputHash
Source§impl PartialEq for OutputHash
impl PartialEq for OutputHash
Source§fn eq(&self, other: &OutputHash) -> bool
fn eq(&self, other: &OutputHash) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for OutputHash
Available on crate feature serde only.
impl Serialize for OutputHash
Available on crate feature
serde only.impl Eq for OutputHash
impl StructuralPartialEq for OutputHash
Auto Trait Implementations§
impl Freeze for OutputHash
impl RefUnwindSafe for OutputHash
impl Send for OutputHash
impl Sync for OutputHash
impl Unpin for OutputHash
impl UnsafeUnpin for OutputHash
impl UnwindSafe for OutputHash
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.