pub struct WriteHashes {
pub md5: Option<[u8; 16]>,
pub sha1: Option<[u8; 20]>,
pub hash_values: BTreeMap<String, String>,
}Expand description
Hash values configured for writer output.
Fields§
§md5: Option<[u8; 16]>MD5 hash bytes.
sha1: Option<[u8; 20]>SHA1 hash bytes.
hash_values: BTreeMap<String, String>Hash strings keyed by hash identifier.
Implementations§
Source§impl WriteHashes
impl WriteHashes
Sourcepub fn copy_hash_values_from_stored_hashes(&mut self, hashes: &StoredHashes)
pub fn copy_hash_values_from_stored_hashes(&mut self, hashes: &StoredHashes)
Copies stored hash values from an image hash collection.
Sourcepub fn hash_value(&self, identifier: &str) -> Option<&str>
pub fn hash_value(&self, identifier: &str) -> Option<&str>
Returns a hash string by identifier.
Sourcepub fn set_hash_value(
&mut self,
identifier: impl Into<String>,
value: impl Into<String>,
) -> Result<Option<String>>
pub fn set_hash_value( &mut self, identifier: impl Into<String>, value: impl Into<String>, ) -> Result<Option<String>>
Sets a hash string by identifier and returns the previous value.
MD5 and SHA1 values are also parsed into typed byte arrays.
§Errors
Returns an error if an MD5, SHA1, or SHA256 value is not valid hexadecimal of
the required length.
Sourcepub fn number_of_hash_values(&self) -> usize
pub fn number_of_hash_values(&self) -> usize
Returns the number of configured hash strings.
Sourcepub fn hash_value_identifier(&self, index: usize) -> Option<&str>
pub fn hash_value_identifier(&self, index: usize) -> Option<&str>
Returns a hash identifier by enumeration index.
Trait Implementations§
Source§impl Clone for WriteHashes
impl Clone for WriteHashes
Source§impl Debug for WriteHashes
impl Debug for WriteHashes
Source§impl Default for WriteHashes
impl Default for WriteHashes
impl Eq for WriteHashes
Source§impl PartialEq for WriteHashes
impl PartialEq for WriteHashes
impl StructuralPartialEq for WriteHashes
Auto Trait Implementations§
impl Freeze for WriteHashes
impl RefUnwindSafe for WriteHashes
impl Send for WriteHashes
impl Sync for WriteHashes
impl Unpin for WriteHashes
impl UnsafeUnpin for WriteHashes
impl UnwindSafe for WriteHashes
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more