pub enum Unexpected<'a> {
}
Expand description
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§
Bool(bool)
The input contained a boolean value that was not expected.
Unsigned(u64)
The input contained an unsigned integer u8
, u16
, u32
or u64
that
was not expected.
Signed(i64)
The input contained a signed integer i8
, i16
, i32
or i64
that
was not expected.
Float(f64)
The input contained a floating point f32
or f64
that was not
expected.
Char(char)
The input contained a char
that was not expected.
Str(&'a str)
The input contained a &str
or String
that was not expected.
Bytes(&'a [u8])
The input contained a &[u8]
or Vec<u8>
that was not expected.
Unit
The input contained a unit ()
that was not expected.
Option
The input contained an Option<T>
that was not expected.
NewtypeStruct
The input contained a newtype struct that was not expected.
Seq
The input contained a sequence that was not expected.
Map
The input contained a map that was not expected.
Enum
The input contained an enum that was not expected.
UnitVariant
The input contained a unit variant that was not expected.
NewtypeVariant
The input contained a newtype variant that was not expected.
TupleVariant
The input contained a tuple variant that was not expected.
StructVariant
The input contained a struct variant that was not expected.
Other(&'a str)
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§
Source§impl<'a> Clone for Unexpected<'a>
impl<'a> Clone for Unexpected<'a>
Source§fn clone(&self) -> Unexpected<'a>
fn clone(&self) -> Unexpected<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for Unexpected<'a>
impl<'a> Debug for Unexpected<'a>
Source§impl<'a> Display for Unexpected<'a>
impl<'a> Display for Unexpected<'a>
Source§impl<'a> PartialEq for Unexpected<'a>
impl<'a> PartialEq for Unexpected<'a>
impl<'a> Copy for Unexpected<'a>
impl<'a> StructuralPartialEq for Unexpected<'a>
Auto Trait Implementations§
impl<'a> Freeze for Unexpected<'a>
impl<'a> RefUnwindSafe for Unexpected<'a>
impl<'a> Send for Unexpected<'a>
impl<'a> Sync for Unexpected<'a>
impl<'a> Unpin for Unexpected<'a>
impl<'a> UnwindSafe for Unexpected<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes
Size for each variant:
Bool
: 1 byteUnsigned
: 15 bytesSigned
: 15 bytesFloat
: 15 bytesChar
: 7 bytesStr
: 11 bytesBytes
: 11 bytesUnit
: 0 bytesOption
: 0 bytesNewtypeStruct
: 0 bytesSeq
: 0 bytesMap
: 0 bytesEnum
: 0 bytesUnitVariant
: 0 bytesNewtypeVariant
: 0 bytesTupleVariant
: 0 bytesStructVariant
: 0 bytesOther
: 11 bytes