Trait Versioned

Source
pub trait Versioned: Serialize + for<'de> Deserialize<'de> {
    // Provided methods
    fn max_serialized_size() -> u64 { ... }
    fn deserialize_from<R>(reader: &mut R, _version: Version) -> Result<Self>
       where R: Read + ?Sized,
             for<'de> Self: Deserialize<'de> { ... }
    fn serialize_into<W>(&self, writer: &mut W) -> Result<()>
       where W: Write,
             Self: Serialize { ... }
}
Expand description

This trait is assigned to all versions of a versioned type and is the only means of serialization/deserialization we use.

It also allows versions to serialize/deserialize themselves differently on a per-version basis. Doing this here enforces consistency at a given filesystem version.

Provided Methods§

Source

fn max_serialized_size() -> u64

Source

fn deserialize_from<R>(reader: &mut R, _version: Version) -> Result<Self>
where R: Read + ?Sized, for<'de> Self: Deserialize<'de>,

Source

fn serialize_into<W>(&self, writer: &mut W) -> Result<()>
where W: Write, Self: Serialize,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Versioned for AllocatorValueV32

Source§

impl Versioned for JournalRecordV40

Source§

impl Versioned for JournalRecordV41

Source§

impl Versioned for JournalRecordV42

Source§

impl Versioned for JournalRecordV43

Source§

impl Versioned for JournalRecordV46

Source§

impl Versioned for SuperBlockRecordV40

Source§

impl Versioned for SuperBlockRecordV41

Source§

impl Versioned for SuperBlockRecordV43

Source§

impl Versioned for SuperBlockRecordV46

Source§

impl Versioned for ObjectValueV32

Source§

impl Versioned for ObjectValueV33

Source§

impl Versioned for ObjectValueV37

Source§

impl Versioned for ObjectValueV38

Source§

impl Versioned for ObjectValueV40

Source§

impl Versioned for ObjectValueV41

Source§

impl Versioned for ObjectValueV46

Source§

impl Versioned for MutationV40

Source§

impl Versioned for MutationV41

Source§

impl Versioned for MutationV43

Source§

impl Versioned for MutationV46

Source§

impl Versioned for LayerHeaderV39

Source§

impl Versioned for LayerInfoV39

Source§

impl Versioned for OldLayerInfoV32

Source§

impl Versioned for AllocatorInfoV32

Source§

impl Versioned for AllocatorKeyV32

Source§

impl Versioned for SuperBlockHeaderV32

Source§

impl Versioned for FsverityMetadataV33

Source§

impl Versioned for ObjectKeyV32

Source§

impl Versioned for ObjectKeyV40

Source§

impl Versioned for ObjectKeyV43

Source§

impl Versioned for StoreInfoV32

Source§

impl Versioned for StoreInfoV36

Source§

impl Versioned for StoreInfoV40

Source§

impl Versioned for ObjectStoreMutationV41

Source§

impl Versioned for ObjectStoreMutationV43

Source§

impl Versioned for ObjectStoreMutationV46

Source§

impl Versioned for EncryptedMutations