Skip to main content

CheckpointableState

Trait CheckpointableState 

Source
pub trait CheckpointableState: Sized {
    // Required methods
    fn serialize(&self) -> Vec<u8> ;
    fn deserialize(data: &[u8]) -> Result<Self>;
}
Expand description

Any streaming operator state that can be serialised and restored.

Required Methods§

Source

fn serialize(&self) -> Vec<u8>

Serialise the state to a byte vector.

Source

fn deserialize(data: &[u8]) -> Result<Self>

Deserialise from a byte slice.

§Errors

Returns an error if the bytes are malformed.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl CheckpointableState for HashMap<String, f64>

Source§

fn serialize(&self) -> Vec<u8>

Source§

fn deserialize(data: &[u8]) -> Result<Self>

Source§

impl CheckpointableState for Vec<f64>

Source§

fn serialize(&self) -> Vec<u8>

Source§

fn deserialize(data: &[u8]) -> Result<Self>

Implementors§