pub enum ErrorKind {
Msg(String),
StringTooLong(usize),
UnableToCoerce(&'static str),
EmptyString,
StringTooLongForChar(usize),
ExpectingNull,
InvalidKeyType(String),
ArrayIndexOutOfBounds(u32, u32),
Js(Throw),
CastError,
// some variants omitted
}
Expand description
The kind of an error.
Variants§
Msg(String)
A convenient variant for String.
StringTooLong(usize)
nodejs has a hard coded limit on string length trying to serialize a string that is too long will result in an error
UnableToCoerce(&'static str)
when deserializing to a boolean false
undefined
null
number
are valid inputs
any other types will result in error
EmptyString
occurs when deserializing a char from an empty string
StringTooLongForChar(usize)
occurs when deserializing a char from a sting with more than one character
ExpectingNull
occurs when a deserializer expects a null
or undefined
property and found another type
InvalidKeyType(String)
occurs when deserializing to an enum and the source object has a none-1 number of properties
ArrayIndexOutOfBounds(u32, u32)
an internal deserialization error from an invalid array
Js(Throw)
A JS exception was thrown
CastError
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
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