pub enum DataLengthValidity {
TooSmall,
ValidWhenOptimistic,
Valid,
TooLarge,
}Expand description
Denotes validity depending on the data length.
Variants§
TooSmall
Too small to process (even in the default optimistic mode).
ValidWhenOptimistic
Valid on the optimistic mode (default) but invalid (too small) on the conservative mode.
Valid
Valid also on the conservative mode (i.e. valid on all modes).
TooLarge
Too large to process.
Implementations§
Source§impl DataLengthValidity
impl DataLengthValidity
Sourcepub fn new<const SIZE_BUCKETS: usize>(len: u32) -> DataLengthValiditywhere
FuzzyHashBucketsInfo<SIZE_BUCKETS>: FuzzyHashBucketMapper,
LengthProcessingInfo<SIZE_BUCKETS>: ConstrainedLengthProcessingInfo,
pub fn new<const SIZE_BUCKETS: usize>(len: u32) -> DataLengthValiditywhere
FuzzyHashBucketsInfo<SIZE_BUCKETS>: FuzzyHashBucketMapper,
LengthProcessingInfo<SIZE_BUCKETS>: ConstrainedLengthProcessingInfo,
Gets the validity value depending on the input data length and the number of buckets.
The SIZE_BUCKETS parameter shall be the one of the bucket size
constants in tlsh::buckets.
Sourcepub fn is_err(&self) -> bool
pub fn is_err(&self) -> bool
Checks whether this validity value is a hard error (i.e. whether this is an error on all modes).
Sourcepub fn is_err_on(&self, mode: DataLengthProcessingMode) -> bool
pub fn is_err_on(&self, mode: DataLengthProcessingMode) -> bool
Checks whether this validity value is an error on the specified processing mode.
Trait Implementations§
Source§impl Clone for DataLengthValidity
impl Clone for DataLengthValidity
Source§fn clone(&self) -> DataLengthValidity
fn clone(&self) -> DataLengthValidity
Returns a duplicate 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 DataLengthValidity
impl Debug for DataLengthValidity
Source§impl PartialEq for DataLengthValidity
impl PartialEq for DataLengthValidity
impl Copy for DataLengthValidity
impl Eq for DataLengthValidity
impl StructuralPartialEq for DataLengthValidity
Auto Trait Implementations§
impl Freeze for DataLengthValidity
impl RefUnwindSafe for DataLengthValidity
impl Send for DataLengthValidity
impl Sync for DataLengthValidity
impl Unpin for DataLengthValidity
impl UnwindSafe for DataLengthValidity
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