Enum ErrorKind

Source
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§

Source§

impl ErrorKind

Source

pub fn description(&self) -> &str

A string describing the error kind.

Trait Implementations§

Source§

impl Debug for ErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ErrorKind

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a str> for ErrorKind

Source§

fn from(s: &'a str) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ErrorKind

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ErrorKind> for Error

Source§

fn from(e: ErrorKind) -> Self

Converts to this type from the input type.
Source§

impl From<String> for ErrorKind

Source§

fn from(s: String) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.