pub enum InvalidColumn {
EmptyDictionary,
FirstOffsetNotZero,
DecreasingOffsets,
TokenTooLarge,
MissingPadding,
CodeOutOfRange,
BadRowOffsets,
DecodedLenOverflow,
EmptyToken,
UnsortedTokens,
IncompleteAlphabet,
}Expand description
A violation found while validating compressed buffers.
Two kinds. Safety violations would let an unchecked decoder read or write
out of bounds, or prevent a search tokenizer from making progress — these are
exactly the obligations an unsafe safety-level constructor must uphold. A
safety-valid dictionary can still be semantically malformed. Conformance
violations decode safely but make search/tokenize give wrong answers.
validate_safety checks only the former; validate checks both.
Variants§
EmptyDictionary
The dictionary has no token, so it cannot be used by the search tokenizer.
FirstOffsetNotZero
The first dictionary offset is not zero.
DecreasingOffsets
Dictionary offsets decrease (offsets[i] > offsets[i + 1]), which would
underflow the unchecked token-length subtraction.
TokenTooLarge
A dictionary token is longer than MAX_TOKEN_SIZE.
MissingPadding
A token offset has fewer than MAX_TOKEN_SIZE
readable bytes after it, so the decoder’s fixed-width read runs off the end.
CodeOutOfRange
The dictionary has more than 2^16 entries, or a code does not index the
dictionary (code >= num_tokens). In either case, the u16 token/code
type cannot address the requested entry.
BadRowOffsets
Row offsets are not non-decreasing, or the last exceeds the code count.
DecodedLenOverflow
The column’s tokens sum to more than usize::MAX decoded bytes, so the
decoded-length computation overflows and would under-size the output buffer.
EmptyToken
A dictionary token has zero length (offsets are not strictly increasing), so the search tokenizer would not make progress.
UnsortedTokens
Dictionary tokens are not in strictly ascending bytewise order, so they are not sorted (binary search breaks) or not unique.
IncompleteAlphabet
The dictionary lacks one or more of the 256 single-byte tokens, so some inputs are not encodable.
Trait Implementations§
Source§impl Clone for InvalidColumn
impl Clone for InvalidColumn
Source§fn clone(&self) -> InvalidColumn
fn clone(&self) -> InvalidColumn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InvalidColumn
Source§impl Debug for InvalidColumn
impl Debug for InvalidColumn
Source§impl Display for InvalidColumn
impl Display for InvalidColumn
impl Eq for InvalidColumn
Source§impl Error for InvalidColumn
impl Error for InvalidColumn
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
use the Display impl or to_string()
Source§impl PartialEq for InvalidColumn
impl PartialEq for InvalidColumn
impl StructuralPartialEq for InvalidColumn
Auto Trait Implementations§
impl Freeze for InvalidColumn
impl RefUnwindSafe for InvalidColumn
impl Send for InvalidColumn
impl Sync for InvalidColumn
impl Unpin for InvalidColumn
impl UnsafeUnpin for InvalidColumn
impl UnwindSafe for InvalidColumn
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.