[][src]Trait serde_version::DeserializeVersioned

pub trait DeserializeVersioned<'de, VM: VersionMap = DefaultVersionMap>: Deserialize<'de> {
    fn deserialize_versioned<D>(
        deserializer: D,
        _version_map: &'de VM
    ) -> Result<Self, Error<D::Error>>
    where
        D: Deserializer<'de>
;
fn next_element<S>(
        seq_access: &mut S,
        _version_map: &'de VM
    ) -> Result<Option<Self>, Error<S::Error>>
    where
        S: SeqAccess<'de>
;
fn next_value<M>(
        map_access: &mut M,
        _version_map: &'de VM
    ) -> Result<Self, Error<M::Error>>
    where
        M: MapAccess<'de>
;
fn next_key<M>(
        map_access: &mut M,
        _version_map: &'de VM
    ) -> Result<Option<Self>, Error<M::Error>>
    where
        M: MapAccess<'de>
;
fn variant<E>(
        enum_access: E,
        _version_map: &'de VM
    ) -> Result<(Self, E::Variant), Error<E::Error>>
    where
        E: EnumAccess<'de>
; }

Trait for versioning support during deserialization

Use the derive feature to generate the implementation from #[derive(DeserializeVersioned)] and #[versions(...)] attribute.

Required methods

fn deserialize_versioned<D>(
    deserializer: D,
    _version_map: &'de VM
) -> Result<Self, Error<D::Error>> where
    D: Deserializer<'de>, 

Entry point for the versioned deserialization

Implement this method to specialize the deserialization for a particular type.

The default implementation ignore the versioning

fn next_element<S>(
    seq_access: &mut S,
    _version_map: &'de VM
) -> Result<Option<Self>, Error<S::Error>> where
    S: SeqAccess<'de>, 

Entry point for deserializing an element in a sequence

Implement this method to specialize the deserialization for a particular type.

The default implementation ignore the versioning

fn next_value<M>(
    map_access: &mut M,
    _version_map: &'de VM
) -> Result<Self, Error<M::Error>> where
    M: MapAccess<'de>, 

Entry point for deserializing the next map value

Implement this method to specialize the deserialization for a particular type.

The default implementation ignore the versioning

fn next_key<M>(
    map_access: &mut M,
    _version_map: &'de VM
) -> Result<Option<Self>, Error<M::Error>> where
    M: MapAccess<'de>, 

Entry point for deserializing the next key value

Implement this method to specialize the deserialization for a particular type.

The default implementation ignore the versioning

fn variant<E>(
    enum_access: E,
    _version_map: &'de VM
) -> Result<(Self, E::Variant), Error<E::Error>> where
    E: EnumAccess<'de>, 

Entry point for deserializing the next variant

Implement this method to specialize the deserialization for a particular type.

The default implementation ignore the versioning

Loading content...

Implementors

impl<'de, VM: VersionMap, T: Deserialize<'de>> DeserializeVersioned<'de, VM> for T[src]

Loading content...