Trait SerializableState

pub trait SerializableState
where
    Self: Sized,

Types which can serialize the internal state and be restored from it.

Compatibility

Serialized state can be assumed to be stable across backwards compatible versions of an implementation crate, i.e. any 0.x.y version of a crate should be able to decode data serialized with any other 0.x.z version, but it may not be able to correctly decode data serialized with a non-x version.

This guarantee is a subject to issues such as security fixes.

SECURITY WARNING

Serialized state may contain sensitive data.

Associated Types

type SerializedStateSize: ArraySize;

Size of serialized internal state.

Required Methods

fn serialize(&self) -> SerializedState<Self>

Serialize and return internal state.

fn deserialize(serialized_state: &SerializedState<Self>) -> Result<Self, DeserializeStateError>

Create an object from serialized internal state.

Errors

If the serialized state could not be deserialized successfully.

Implementors