#[non_exhaustive]pub enum OffsetIntegrityIssue {
Length {
expected: usize,
actual: usize,
},
CountOverflow {
count: usize,
},
FirstNonZero {
actual: usize,
},
NonMonotonic {
index: usize,
previous: usize,
actual: usize,
},
FinalMismatch {
final_offset: usize,
value_len: usize,
},
ValueOutOfRange {
index: usize,
value: usize,
bound: usize,
},
UsizeOverflow {
index: usize,
},
}Expand description
Reasons a borrowed offset or value array failed structural validation.
§Performance
Formatting is O(message length).
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.
Length
Length did not match count + 1.
CountOverflow
expected_count + 1 overflowed usize, so no valid length exists.
FirstNonZero
offsets[0] was not zero.
NonMonotonic
offsets[index] < offsets[index - 1].
Fields
FinalMismatch
offsets[count] did not match value_len.
ValueOutOfRange
A value at index was not less than the dense bound.
Fields
UsizeOverflow
A word’s value at index did not fit in usize on the current target.
Trait Implementations§
Source§impl Clone for OffsetIntegrityIssue
impl Clone for OffsetIntegrityIssue
Source§fn clone(&self) -> OffsetIntegrityIssue
fn clone(&self) -> OffsetIntegrityIssue
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 OffsetIntegrityIssue
impl Debug for OffsetIntegrityIssue
Source§impl Display for OffsetIntegrityIssue
impl Display for OffsetIntegrityIssue
Source§impl Error for OffsetIntegrityIssue
impl Error for OffsetIntegrityIssue
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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 PartialEq for OffsetIntegrityIssue
impl PartialEq for OffsetIntegrityIssue
Source§fn eq(&self, other: &OffsetIntegrityIssue) -> bool
fn eq(&self, other: &OffsetIntegrityIssue) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for OffsetIntegrityIssue
impl Eq for OffsetIntegrityIssue
impl StructuralPartialEq for OffsetIntegrityIssue
Auto Trait Implementations§
impl Freeze for OffsetIntegrityIssue
impl RefUnwindSafe for OffsetIntegrityIssue
impl Send for OffsetIntegrityIssue
impl Sync for OffsetIntegrityIssue
impl Unpin for OffsetIntegrityIssue
impl UnsafeUnpin for OffsetIntegrityIssue
impl UnwindSafe for OffsetIntegrityIssue
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