pub trait Visitor<'de>: Sized {
    type Value;
    type ArrayElem;

Show 25 methods // Provided methods fn visit_none(&self) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_bool( &self, _v: bool ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_int( &self, _v: i32 ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_long( &self, _v: i64 ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_float( &self, _v: f32 ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_double( &self, _v: f64 ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_string( &self, _v: &'de str ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_bytes( &self, _v: &'de [u8] ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_rectangle( &self, _v: Rectangle ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_fraction( &self, _v: Fraction ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_id( &self, _v: Id ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_fd( &self, _v: Fd ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_struct( &self, _struct_deserializer: &mut StructPodDeserializer<'de> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_array( &self, _elements: Vec<Self::ArrayElem> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_object( &self, _object_deserializer: &mut ObjectPodDeserializer<'de> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_choice_bool( &self, _choice: Choice<bool> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_choice_i32( &self, _choice: Choice<i32> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_choice_i64( &self, _choice: Choice<i64> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_choice_f32( &self, _choice: Choice<f32> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_choice_f64( &self, _choice: Choice<f64> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_choice_id( &self, _choice: Choice<Id> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_choice_rectangle( &self, _choice: Choice<Rectangle> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_choice_fraction( &self, _choice: Choice<Fraction> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_choice_fd( &self, _choice: Choice<Fd> ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... } fn visit_pointer( &self, _type: u32, _pointer: *const c_void ) -> Result<Self::Value, DeserializeError<&'de [u8]>> { ... }
}
Expand description

This trait represents a visitor is “driven” by the deserializer to construct an instance of your type.

Required Associated Types§

source

type Value

The value produced by this visitor

source

type ArrayElem

The element type Visitor::visit_array is expecting as input. Only used for visitors implementing this method, std::convert::Infallible can be used as a default.

Provided Methods§

source

fn visit_none(&self) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a none.

source

fn visit_bool( &self, _v: bool ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a bool.

source

fn visit_int(&self, _v: i32) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an i32.

source

fn visit_long( &self, _v: i64 ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an i64.

source

fn visit_float( &self, _v: f32 ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an f32.

source

fn visit_double( &self, _v: f64 ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an f64.

source

fn visit_string( &self, _v: &'de str ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a string.

source

fn visit_bytes( &self, _v: &'de [u8] ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a bytes array.

source

fn visit_rectangle( &self, _v: Rectangle ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a Rectangle.

source

fn visit_fraction( &self, _v: Fraction ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a Fraction.

source

fn visit_id(&self, _v: Id) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an Id.

source

fn visit_fd(&self, _v: Fd) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an Fd.

source

fn visit_struct( &self, _struct_deserializer: &mut StructPodDeserializer<'de> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a structure.

source

fn visit_array( &self, _elements: Vec<Self::ArrayElem> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an array.

source

fn visit_object( &self, _object_deserializer: &mut ObjectPodDeserializer<'de> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an object.

source

fn visit_choice_bool( &self, _choice: Choice<bool> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an i32 choice.

source

fn visit_choice_i32( &self, _choice: Choice<i32> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an i32 choice.

source

fn visit_choice_i64( &self, _choice: Choice<i64> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains an i64 choice.

source

fn visit_choice_f32( &self, _choice: Choice<f32> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a f32 choice.

source

fn visit_choice_f64( &self, _choice: Choice<f64> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a f64 choice.

source

fn visit_choice_id( &self, _choice: Choice<Id> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a Id choice.

source

fn visit_choice_rectangle( &self, _choice: Choice<Rectangle> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a Rectangle choice.

source

fn visit_choice_fraction( &self, _choice: Choice<Fraction> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a Fraction choice.

source

fn visit_choice_fd( &self, _choice: Choice<Fd> ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a Fd choice.

source

fn visit_pointer( &self, _type: u32, _pointer: *const c_void ) -> Result<Self::Value, DeserializeError<&'de [u8]>>

The input contains a pointer.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'de> Visitor<'de> for BoolVisitor

source§

impl<'de> Visitor<'de> for BytesVisitor

§

type Value = &'de [u8]

§

type ArrayElem = Infallible

source§

impl<'de> Visitor<'de> for ChoiceBoolVisitor

source§

impl<'de> Visitor<'de> for ChoiceDoubleVisitor

source§

impl<'de> Visitor<'de> for ChoiceFdVisitor

source§

impl<'de> Visitor<'de> for ChoiceFloatVisitor

source§

impl<'de> Visitor<'de> for ChoiceFractionVisitor

source§

impl<'de> Visitor<'de> for ChoiceIdVisitor

source§

impl<'de> Visitor<'de> for ChoiceIntVisitor

source§

impl<'de> Visitor<'de> for ChoiceLongVisitor

source§

impl<'de> Visitor<'de> for ChoiceRectangleVisitor

source§

impl<'de> Visitor<'de> for DoubleVisitor

source§

impl<'de> Visitor<'de> for FdVisitor

source§

impl<'de> Visitor<'de> for FloatVisitor

source§

impl<'de> Visitor<'de> for FractionVisitor

source§

impl<'de> Visitor<'de> for IdVisitor

source§

impl<'de> Visitor<'de> for IntVisitor

source§

impl<'de> Visitor<'de> for LongVisitor

source§

impl<'de> Visitor<'de> for NoneVisitor

source§

impl<'de> Visitor<'de> for RectangleVisitor

source§

impl<'de> Visitor<'de> for StringVisitor

§

type Value = &'de str

§

type ArrayElem = Infallible

source§

impl<'de> Visitor<'de> for ValueVisitor

source§

impl<'de, E: CanonicalFixedSizedPod + Copy> Visitor<'de> for VecVisitor<E>

§

type Value = Vec<E>

§

type ArrayElem = E

source§

impl<'de, T> Visitor<'de> for PointerVisitor<T>