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 or SHA1 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§fn clone(&self) -> WriteHashes
fn clone(&self) -> WriteHashes
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 WriteHashes
impl Debug for WriteHashes
Source§impl Default for WriteHashes
impl Default for WriteHashes
Source§fn default() -> WriteHashes
fn default() -> WriteHashes
Returns the “default value” for a type. Read more
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.