Skip to main content

SchemaDecode

Trait SchemaDecode 

Source
pub trait SchemaDecode<'de>: Sized {
    const SCHEMA_ID: u64;

    // Required method
    fn decode_fields(
        decoder: &mut FieldDecoder<'de>,
        encoded_version: u32,
    ) -> Result<Self>;
}
Available on crate feature schema-evolution only.
Expand description

Decoding contract for a type that accepts compatible schema revisions.

Required Associated Constants§

Source

const SCHEMA_ID: u64

Stable identity shared by compatible revisions of this schema.

Required Methods§

Source

fn decode_fields( decoder: &mut FieldDecoder<'de>, encoded_version: u32, ) -> Result<Self>

Constructs a value from stable-ID fields.

encoded_version is available for explicit migrations. Unknown fields remain accessible through FieldDecoder::unknown_fields.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§