Skip to main content

Versioned

Trait Versioned 

Source
pub trait Versioned: Serialize + for<'de> Deserialize<'de> {
    // Provided methods
    fn max_serialized_size() -> Option<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() -> Option<u64>

Maximum size of a serialized version of this type. Serialization and deserialization will fail if the limit is exceeded. If None, there is no limit. None is preferred over u64::MAX because serializing and deserializing with a limit has runtime overhead.

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".

Implementors§

Source§

impl Versioned for AllocatorInfoV32

Source§

impl Versioned for AllocatorKeyV32

Source§

impl Versioned for AllocatorValueV32

Source§

impl Versioned for BlobMetadataV53

Source§

impl Versioned for ChildValueV32

Source§

impl Versioned for EncryptedMutations

Source§

impl Versioned for EncryptedTransactionV57

Source§

impl Versioned for EncryptedTransactionV59

Source§

impl Versioned for EncryptedTransactionV61

Source§

impl Versioned for EncryptedTransactionV62

Source§

impl Versioned for FsverityMetadataV50

Source§

impl Versioned for JournalRecordV56

Source§

impl Versioned for JournalRecordV57

Source§

impl Versioned for JournalRecordV59

Source§

impl Versioned for JournalRecordV60

Source§

impl Versioned for JournalRecordV61

Source§

impl Versioned for JournalRecordV62

Source§

impl Versioned for LayerHeaderV39

Source§

impl Versioned for LayerInfoV39

Source§

impl Versioned for MutationV56

Source§

impl Versioned for MutationV57

Source§

impl Versioned for MutationV59

Source§

impl Versioned for MutationV61

Source§

impl Versioned for MutationV62

Source§

impl Versioned for ObjectKeyV54

Source§

impl Versioned for ObjectKindV49

Source§

impl Versioned for ObjectStoreMutationV56

Source§

impl Versioned for ObjectStoreMutationV59

Source§

impl Versioned for ObjectValueV56

Source§

impl Versioned for ObjectValueV59

Source§

impl Versioned for ObjectValueV62

Source§

impl Versioned for StoreInfoV52

Source§

impl Versioned for SuperBlockHeaderV32

Source§

impl Versioned for SuperBlockHeaderV61

Source§

impl Versioned for SuperBlockRecordV56

Source§

impl Versioned for SuperBlockRecordV59

Source§

impl Versioned for SuperBlockRecordV62