#[non_exhaustive]pub enum GeneratorError {
TooLargeInput,
TooSmallInput,
BucketsAreHalfEmpty,
BucketsAreThreeQuarterEmpty,
}Expand description
An error type representing an error while generating a fuzzy hash.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TooLargeInput
The input data is too large to process.
TooSmallInput
The input data is too small to process.
Whether the input data is too small is normally determined by the value
of DataLengthProcessingMode.
If we prefer compatibility with the original TLSH implementation, we cannot generate a fuzzy hash from the data smaller than 50 bytes.
BucketsAreHalfEmpty
Too many buckets (roughly half or more) are empty.
This error indicates the input data is either too small or too repetitive so that enough number of buckets cannot be filled (i.e. even if we force to output a fuzzy hash, the result might be statistically unreliable).
BucketsAreThreeQuarterEmpty
Too many buckets (roughly 3/4 or more) are empty.
This is similar to BucketsAreHalfEmpty
but indicates more extreme statistic distribution so that computing
a Q ratio will result in a division by zero.
Implementations§
Source§impl GeneratorError
impl GeneratorError
Sourcepub fn category(&self) -> GeneratorErrorCategory
pub fn category(&self) -> GeneratorErrorCategory
Retrieves the category of the generator error.
Trait Implementations§
Source§impl Clone for GeneratorError
impl Clone for GeneratorError
Source§fn clone(&self) -> GeneratorError
fn clone(&self) -> GeneratorError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GeneratorError
impl Debug for GeneratorError
Source§impl Display for GeneratorError
impl Display for GeneratorError
Source§impl Error for GeneratorError
impl Error for GeneratorError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<GeneratorError> for GeneratorOrIOError
Available on crate features easy-functions and std only.
impl From<GeneratorError> for GeneratorOrIOError
easy-functions and std only.