[][src]Enum serde::de::Unexpected

pub enum Unexpected<'a> {
    Bool(bool),
    Unsigned(u64),
    Signed(i64),
    Float(f64),
    Char(char),
    Str(&'a str),
    Bytes(&'a [u8]),
    Unit,
    Option,
    NewtypeStruct,
    Seq,
    Map,
    Enum,
    UnitVariant,
    NewtypeVariant,
    TupleVariant,
    StructVariant,
    Other(&'a str),
}

Unexpected represents an unexpected invocation of any one of the Visitor trait methods.

This is used as an argument to the invalid_type, invalid_value, and invalid_length methods of the Error trait to build error messages.

fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
where
    E: de::Error,
{
    Err(de::Error::invalid_type(Unexpected::Bool(v), &self))
}

Variants

The input contained a boolean value that was not expected.

The input contained an unsigned integer u8, u16, u32 or u64 that was not expected.

The input contained a signed integer i8, i16, i32 or i64 that was not expected.

The input contained a floating point f32 or f64 that was not expected.

The input contained a char that was not expected.

The input contained a &str or String that was not expected.

The input contained a &[u8] or Vec<u8> that was not expected.

The input contained a unit () that was not expected.

The input contained an Option<T> that was not expected.

The input contained a newtype struct that was not expected.

The input contained a sequence that was not expected.

The input contained a map that was not expected.

The input contained an enum that was not expected.

The input contained a unit variant that was not expected.

The input contained a newtype variant that was not expected.

The input contained a tuple variant that was not expected.

The input contained a struct variant that was not expected.

A message stating what uncategorized thing the input contained that was not expected.

The message should be a noun or noun phrase, not capitalized and without a period. An example message is "unoriginal superhero".

Trait Implementations

impl<'a> Clone for Unexpected<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> Copy for Unexpected<'a>
[src]

impl<'a> PartialEq<Unexpected<'a>> for Unexpected<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> Display for Unexpected<'a>
[src]

Formats the value using the given formatter. Read more

impl<'a> Debug for Unexpected<'a>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a> Send for Unexpected<'a>

impl<'a> Sync for Unexpected<'a>

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

Converts the given value to a String. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Important traits for &'a mut R

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Important traits for &'a mut R

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more