pub enum Algorithm {
Ahash,
Blake3,
Foldhash,
Fxhash,
SHA256,
SHA512,
}Expand description
Enum representing supported hash algorithms.
Implements Display to allow serializing the enum variant names in PascalCase,
and ValueEnum for use with clap.
Variants§
Implementations§
Source§impl Algorithm
impl Algorithm
Sourcepub fn calculate_hash(&self, file: File) -> FIFResult<String>
pub fn calculate_hash(&self, file: File) -> FIFResult<String>
Calculate hash from a File (uses a BufReader and Heap buffer).
Sourcepub fn hash_reader<R: Read>(&self, reader: R) -> FIFResult<String>
pub fn hash_reader<R: Read>(&self, reader: R) -> FIFResult<String>
Generic hashing logic for any type implementing Read. This is used by both the main application and the test suite.
Trait Implementations§
Source§impl Display for Algorithm
Implements fmt::Display for Algorithm to display variant names in PascalCase.
impl Display for Algorithm
Implements fmt::Display for Algorithm to display variant names in PascalCase.
impl Copy for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnsafeUnpin for Algorithm
impl UnwindSafe for Algorithm
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<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