Macro serde::forward_to_deserialize [] [src]

macro_rules! forward_to_deserialize {
    ($($func:ident)*) => { ... };
}

Helper to forward Deserializer methods to Deserializer::deserialize. Every given method ignores all arguments and forwards to deserialize. Note that deserialize_enum simply returns an Error::invalid_type; a better approach is tracked in serde-rs/serde#521.

impl Deserializer for MyDeserializer {
    fn deserialize<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error>
        where V: Visitor
    {
        /* ... */
    }

    forward_to_deserialize! {
        bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
        unit option seq seq_fixed_size bytes map unit_struct newtype_struct
        tuple_struct struct struct_field tuple enum ignored_any
    }
}