Skip to main content

SealableData

Trait SealableData 

Source
pub trait SealableData: Serialize + DeserializeOwned { }
Expand description

Marker trait for data that can be sealed in a DataEnvelope.

Note: If you implement this trait, you agree to the following: The struct serialization format is stable. Struct modifications must maintain backward compatibility with existing serialized data. Changes that break deserialization are considered breaking changes and require a new version and struct.

Ideally, when creating a new struct, create a test vector (a sealed DataEnvelope for a test value), and create a unit test ensuring that it permanently deserializes correctly.

To make breaking changes, introduce a new version. This should use the generate_versioned_sealable! macro to auto-generate the versioning code. Please see the examples directory.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§