pub enum SchemaError {
Show 13 variants
InvalidTypeTag {
tag: u8,
context: Option<String>,
},
ValueCountMismatch {
expected: usize,
actual: usize,
},
UnexpectedEndOfData {
context: String,
position: usize,
},
InvalidVarint {
context: String,
position: usize,
},
InvalidUtf8 {
context: String,
error: FromUtf8Error,
},
TypeMismatch {
field: String,
expected: String,
actual: String,
row: Option<usize>,
},
InvalidNullBitmap {
expected_bytes: usize,
actual_bytes: usize,
},
InvalidInput(String),
InvalidFrame(String),
InvalidCharacter(String),
Compression(String),
Decompression(String),
InvalidCompressionAlgorithm(u8),
}Expand description
Errors that can occur during schema encoding/decoding
This error type covers all failure modes in the schema encoding pipeline: parsing, binary packing/unpacking, compression, and framing.
§Examples
ⓘ
use base_d::{decode_schema, SchemaError};
let result = decode_schema("invalid", false);
match result {
Err(SchemaError::InvalidFrame(msg)) => {
println!("Frame error: {}", msg);
}
Err(SchemaError::InvalidCharacter(msg)) => {
println!("Character error: {}", msg);
}
_ => {}
}Variants§
InvalidTypeTag
Invalid type tag encountered
ValueCountMismatch
Value count mismatch
UnexpectedEndOfData
Unexpected end of data
InvalidVarint
Invalid varint encoding
InvalidUtf8
Invalid UTF-8 string
TypeMismatch
Type mismatch between value and field type
InvalidNullBitmap
Invalid null bitmap size
InvalidInput(String)
Invalid input format
InvalidFrame(String)
Invalid frame delimiters
InvalidCharacter(String)
Invalid character in encoded data
Compression(String)
Compression error
Decompression(String)
Decompression error
InvalidCompressionAlgorithm(u8)
Invalid compression algorithm byte
Trait Implementations§
Source§impl Debug for SchemaError
impl Debug for SchemaError
Source§impl Display for SchemaError
impl Display for SchemaError
Source§impl Error for SchemaError
impl Error for SchemaError
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 SchemaError
impl PartialEq for SchemaError
impl StructuralPartialEq for SchemaError
Auto Trait Implementations§
impl Freeze for SchemaError
impl RefUnwindSafe for SchemaError
impl Send for SchemaError
impl Sync for SchemaError
impl Unpin for SchemaError
impl UnwindSafe for SchemaError
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