pub enum ConversionError {
Show 15 variants
TypeMismatch {
expected: String,
got: String,
},
MissingField(String),
MissingIndex(usize),
WrongFieldCount {
expected: usize,
got: usize,
},
ExpectedRecord(String),
ExpectedTuple(String),
ExpectedVariant(String),
ExpectedList(String),
ExpectedOption(String),
UnknownTag {
tag: usize,
max: usize,
},
MissingPayload,
UnexpectedPayload,
FieldError(String, Box<ConversionError>),
IndexError(usize, Box<ConversionError>),
PayloadError(Box<ConversionError>),
}Expand description
Error type for Value conversions
Variants§
TypeMismatch
Type mismatch during conversion
MissingField(String)
Missing field in record
MissingIndex(usize)
Missing index in tuple/list
WrongFieldCount
Wrong number of fields
ExpectedRecord(String)
Expected a record value
ExpectedTuple(String)
Expected a tuple value
ExpectedVariant(String)
Expected a variant value
ExpectedList(String)
Expected a list value
ExpectedOption(String)
Expected an option value
UnknownTag
Unknown variant tag
MissingPayload
Missing payload for variant
UnexpectedPayload
Unexpected payload for unit variant
FieldError(String, Box<ConversionError>)
Error in field conversion
IndexError(usize, Box<ConversionError>)
Error in index conversion
PayloadError(Box<ConversionError>)
Error in payload conversion
Trait Implementations§
Source§impl Clone for ConversionError
impl Clone for ConversionError
Source§fn clone(&self) -> ConversionError
fn clone(&self) -> ConversionError
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 ConversionError
impl Debug for ConversionError
Auto Trait Implementations§
impl Freeze for ConversionError
impl RefUnwindSafe for ConversionError
impl Send for ConversionError
impl Sync for ConversionError
impl Unpin for ConversionError
impl UnsafeUnpin for ConversionError
impl UnwindSafe for ConversionError
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