Trait destream::de::Visitor[][src]

pub trait Visitor: Send + Sized {
    type Value;
Show methods fn expecting() -> &'static str; fn visit_bool<E: Error>(self, v: bool) -> Result<Self::Value, E> { ... }
fn visit_i8<E: Error>(self, v: i8) -> Result<Self::Value, E> { ... }
fn visit_i16<E: Error>(self, v: i16) -> Result<Self::Value, E> { ... }
fn visit_i32<E: Error>(self, v: i32) -> Result<Self::Value, E> { ... }
fn visit_i64<E: Error>(self, v: i64) -> Result<Self::Value, E> { ... }
fn visit_u8<E: Error>(self, v: u8) -> Result<Self::Value, E> { ... }
fn visit_u16<E: Error>(self, v: u16) -> Result<Self::Value, E> { ... }
fn visit_u32<E: Error>(self, v: u32) -> Result<Self::Value, E> { ... }
fn visit_u64<E: Error>(self, v: u64) -> Result<Self::Value, E> { ... }
fn visit_f32<E: Error>(self, v: f32) -> Result<Self::Value, E> { ... }
fn visit_f64<E: Error>(self, v: f64) -> Result<Self::Value, E> { ... }
fn visit_array_bool<'async_trait, A: ArrayAccess<bool>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_i8<'async_trait, A: ArrayAccess<i8>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_i16<'async_trait, A: ArrayAccess<i16>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_i32<'async_trait, A: ArrayAccess<i32>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_i64<'async_trait, A: ArrayAccess<i64>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_u8<'async_trait, A: ArrayAccess<u8>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_u16<'async_trait, A: ArrayAccess<u16>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_u32<'async_trait, A: ArrayAccess<u32>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_u64<'async_trait, A: ArrayAccess<u64>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_f32<'async_trait, A: ArrayAccess<f32>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_array_f64<'async_trait, A: ArrayAccess<f64>>(
        self,
        _array: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_string<E: Error>(self, v: String) -> Result<Self::Value, E> { ... }
fn visit_byte_buf<E: Error>(self, _v: Vec<u8>) -> Result<Self::Value, E> { ... }
fn visit_unit<E: Error>(self) -> Result<Self::Value, E> { ... }
fn visit_none<E: Error>(self) -> Result<Self::Value, E> { ... }
fn visit_some<'life0, 'async_trait, D: Decoder>(
        self,
        _decoder: &'life0 mut D
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, D::Error>> + Send + 'async_trait>>
    where
        D: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_map<'async_trait, A: MapAccess>(
        self,
        _map: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
fn visit_seq<'async_trait, A: SeqAccess>(
        self,
        _seq: A
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, A::Error>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        Self: 'async_trait
, { ... }
}
Expand description

This trait describes a visitor responsible for decoding a stream.

Based on serde::de::Visitor.

Associated Types

The type which this Visitor is responsible for decoding.

Required methods

Format a message stating what data this Visitor expects to receive.

This is used in error messages. The message should complete the sentence “This Visitor expects to receive …”, for example the message could be “an integer between 0 and 64”. The message should not be capitalized and should not end with a period.

Provided methods

The input contains a boolean.

The default implementation fails with a type error.

The input contains an i8.

The default implementation forwards to visit_i64.

The input contains an i16.

The default implementation forwards to visit_i64.

The input contains an i32.

The default implementation forwards to visit_i64.

The input contains an i64.

The default implementation fails with a type error.

The input contains a u8.

The default implementation forwards to visit_u64.

The input contains a u16.

The default implementation forwards to visit_u64.

The input contains a u32.

The default implementation forwards to visit_u64.

The input contains a u64.

The default implementation fails with a type error.

The input contains an f32.

The default implementation forwards to visit_f64.

The input contains an f64.

The default implementation fails with a type error.

The input contains an array of bools.

The default implementation fails with a type error.

The input contains an array of i8s.

The default implementation fails with a type error.

The input contains an array of i16s.

The default implementation fails with a type error.

The input contains an array of i32s.

The default implementation fails with a type error.

The input contains an array of i64s.

The default implementation fails with a type error.

The input contains an array of u8s.

The default implementation fails with a type error.

The input contains an array of u16s.

The default implementation fails with a type error.

The input contains an array of u32s.

The default implementation fails with a type error.

The input contains an array of u64s.

The default implementation fails with a type error.

The input contains an array of f32s.

The default implementation fails with a type error.

The input contains an array of f64s.

The default implementation fails with a type error.

The input contains a string and ownership of the string is being given to the Visitor.

The default implementation fails with a type error.

The input contains a byte array and ownership of the byte array is being given to the Visitor.

The default implementation fails with a type error.

The input contains a unit ().

The default implementation fails with a type error.

The input contains an optional that is absent. The default implementation fails with a type error.

The input contains an optional that is present. The default implementation fails with a type error.

The input contains a key-value map. The default implementation fails with a type error.

The input contains a sequence of elements. The default implementation fails with a type error.

Implementors