Enum ssdeep::GeneratorError
source · #[repr(u8)]
#[non_exhaustive]
pub enum GeneratorError {
FixedSizeMismatch,
FixedSizeTooLarge,
InputSizeTooLarge,
OutputOverflow,
}Expand description
The error type for either invalid or unsupported operations of Generator.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
FixedSizeMismatch
Fixed size has a mismatch to either previously set value or the final input size.
FixedSizeTooLarge
Fixed size is too large.
InputSizeTooLarge
Total input size on finalization is too large.
OutputOverflow
Output would cause a buffer overflow for specific output type.
This kind of error only occurs when:
- Truncation is disabled,
- The output type is a short form
(because of those conditions, it only occurs on a rawGenerator::finalize_rawcall) and - The resulting block hash 2 is longer than that of the
short form limit (
BlockHash::HALF_SIZE).
Implementations§
source§impl GeneratorError
impl GeneratorError
sourcepub fn is_size_too_large_error(&self) -> bool
pub fn is_size_too_large_error(&self) -> bool
Checks whether this error is raised by one of the “size too large” cases.
It returns true on either FixedSizeTooLarge
or InputSizeTooLarge variants.
Trait Implementations§
source§impl Clone for GeneratorError
impl Clone for GeneratorError
source§fn clone(&self) -> GeneratorError
fn clone(&self) -> GeneratorError
Returns a copy of the value. Read more
1.0.0 · 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 GeneratorError
impl Debug for GeneratorError
source§impl Display for GeneratorError
impl Display for GeneratorError
source§impl Error for GeneratorError
Available on crate feature std only.
impl Error for GeneratorError
Available on crate feature
std only.1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<GeneratorError> for GeneratorOrIOError
Available on crate features std and easy-functions only.
impl From<GeneratorError> for GeneratorOrIOError
Available on crate features
std and easy-functions only.source§fn from(value: GeneratorError) -> Self
fn from(value: GeneratorError) -> Self
Converts to this type from the input type.
source§impl PartialEq<GeneratorError> for GeneratorError
impl PartialEq<GeneratorError> for GeneratorError
source§fn eq(&self, other: &GeneratorError) -> bool
fn eq(&self, other: &GeneratorError) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Copy for GeneratorError
impl Eq for GeneratorError
impl StructuralEq for GeneratorError
impl StructuralPartialEq for GeneratorError
Auto Trait Implementations§
impl RefUnwindSafe for GeneratorError
impl Send for GeneratorError
impl Sync for GeneratorError
impl Unpin for GeneratorError
impl UnwindSafe for GeneratorError
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