pub enum DxError {
Show 25 variants
UnexpectedEof(usize),
ParseError {
location: SourceLocation,
message: String,
snippet: String,
},
InvalidSyntax {
pos: usize,
msg: String,
},
SchemaError(String),
TypeMismatch {
expected: String,
actual: String,
},
UnknownAlias(String),
UnknownAnchor(String),
InvalidTypeHint(String),
InvalidNumber(String),
Utf8Error {
offset: usize,
},
Base62Error {
char: char,
position: usize,
message: String,
},
IntegerOverflow,
InvalidMagic(u8, u8),
UnsupportedVersion {
found: u8,
expected: u8,
},
BufferTooSmall {
required: usize,
available: usize,
},
CompressionError(String),
DecompressionError(String),
Io(String),
UnsupportedPlatform(String),
ConversionError(String),
DittoNoPrevious(usize),
PrefixError(String),
InputTooLarge {
size: usize,
max: usize,
},
RecursionLimitExceeded {
depth: usize,
max: usize,
},
TableTooLarge {
rows: usize,
max: usize,
},
}Expand description
Comprehensive error type for all DX serializer operations
Variants§
UnexpectedEof(usize)
Unexpected end of input during parsing
ParseError
Parse error with location information and snippet
Fields
location: SourceLocationSource location where parsing failed.
InvalidSyntax
Invalid syntax at a specific position
Fields
SchemaError(String)
Schema validation error
TypeMismatch
Type mismatch during parsing or conversion
Fields
UnknownAlias(String)
Unknown alias reference
UnknownAnchor(String)
Unknown anchor reference
InvalidTypeHint(String)
Invalid type hint in schema
InvalidNumber(String)
Invalid number format
Utf8Error
Invalid UTF-8 sequence
Base62Error
Invalid Base62 character
Fields
IntegerOverflow
Integer overflow during encoding/decoding
InvalidMagic(u8, u8)
Invalid magic bytes in binary header
UnsupportedVersion
Unsupported binary format version
BufferTooSmall
Buffer too small for operation
CompressionError(String)
Compression operation failed
DecompressionError(String)
Decompression operation failed
Io(String)
General I/O error (wraps std::io::Error message)
UnsupportedPlatform(String)
Platform not supported for operation
ConversionError(String)
Format conversion error
DittoNoPrevious(usize)
Ditto operator without previous value
PrefixError(String)
Prefix inheritance failed
InputTooLarge
Input size exceeds maximum allowed
RecursionLimitExceeded
Recursion depth exceeds maximum allowed
TableTooLarge
Table row count exceeds maximum allowed
Implementations§
Source§impl DxError
impl DxError
Sourcepub fn parse_error(
input: &[u8],
offset: usize,
message: impl Into<String>,
) -> Self
pub fn parse_error( input: &[u8], offset: usize, message: impl Into<String>, ) -> Self
Create a parse error with location information and snippet
Sourcepub fn parse_error_with_location(
location: SourceLocation,
message: impl Into<String>,
snippet: impl Into<String>,
) -> Self
pub fn parse_error_with_location( location: SourceLocation, message: impl Into<String>, snippet: impl Into<String>, ) -> Self
Create a parse error with explicit location and snippet
Sourcepub fn type_mismatch(
expected: impl Into<String>,
actual: impl Into<String>,
) -> Self
pub fn type_mismatch( expected: impl Into<String>, actual: impl Into<String>, ) -> Self
Create a type mismatch error
Sourcepub fn utf8_error(offset: usize) -> Self
pub fn utf8_error(offset: usize) -> Self
Create a UTF-8 error at a specific offset
Sourcepub fn base62_error(
char: char,
position: usize,
message: impl Into<String>,
) -> Self
pub fn base62_error( char: char, position: usize, message: impl Into<String>, ) -> Self
Create a Base62 error with position
Sourcepub fn invalid_magic(byte0: u8, byte1: u8) -> Self
pub fn invalid_magic(byte0: u8, byte1: u8) -> Self
Create an invalid magic error
Sourcepub fn unsupported_version(found: u8) -> Self
pub fn unsupported_version(found: u8) -> Self
Create an unsupported version error
Sourcepub fn buffer_too_small(required: usize, available: usize) -> Self
pub fn buffer_too_small(required: usize, available: usize) -> Self
Create a buffer too small error
Sourcepub fn input_too_large(size: usize) -> Self
pub fn input_too_large(size: usize) -> Self
Create an input too large error
Sourcepub fn recursion_limit_exceeded(depth: usize) -> Self
pub fn recursion_limit_exceeded(depth: usize) -> Self
Create a recursion limit exceeded error
Sourcepub fn table_too_large(rows: usize) -> Self
pub fn table_too_large(rows: usize) -> Self
Create a table too large error
Sourcepub fn location(&self) -> Option<&SourceLocation>
pub fn location(&self) -> Option<&SourceLocation>
Get the source location if available
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this is a recoverable error
Trait Implementations§
Source§impl Error for DxError
impl Error for DxError
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 From<ConvertError> for DxError
impl From<ConvertError> for DxError
Source§fn from(err: ConvertError) -> Self
fn from(err: ConvertError) -> Self
Convert a ConvertError into a DxError.
This conversion handles all ConvertError variants:
LlmParse: Converts the underlying ParseError to DxErrorHumanParse: Converts to ConversionError with the error messageMachineFormat: Converts to ConversionError with the error message
Source§impl From<FromUtf8Error> for DxError
impl From<FromUtf8Error> for DxError
Source§fn from(err: FromUtf8Error) -> Self
fn from(err: FromUtf8Error) -> Self
Source§impl From<ParseError> for DxError
impl From<ParseError> for DxError
Source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Convert a ParseError from the LLM parser into a DxError.
This conversion preserves position information where available, mapping each ParseError variant to the most appropriate DxError variant.
impl StructuralPartialEq for DxError
Auto Trait Implementations§
impl Freeze for DxError
impl RefUnwindSafe for DxError
impl Send for DxError
impl Sync for DxError
impl Unpin for DxError
impl UnsafeUnpin for DxError
impl UnwindSafe for DxError
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.