Checkpoint

Trait Checkpoint 

Source
pub trait Checkpoint {
    // Required methods
    fn checkpoint(&self) -> Result<Vec<u8>, Error>;
    fn restore(&mut self, data: &[u8]) -> Result<(), Error>;
}
Expand description

Trait for types that can be check-pointed and restored.

This is to be used for any additional state within circuit operators that’s not stored within a batch (which are already stored in files).

Required Methods§

Source

fn checkpoint(&self) -> Result<Vec<u8>, Error>

Source

fn restore(&mut self, data: &[u8]) -> Result<(), Error>

Implementations on Foreign Types§

Source§

impl Checkpoint for i32

Source§

fn checkpoint(&self) -> Result<Vec<u8>, Error>

Source§

fn restore(&mut self, _data: &[u8]) -> Result<(), Error>

Source§

impl Checkpoint for isize

Source§

fn checkpoint(&self) -> Result<Vec<u8>, Error>

Source§

fn restore(&mut self, _data: &[u8]) -> Result<(), Error>

Source§

impl Checkpoint for usize

Source§

fn checkpoint(&self) -> Result<Vec<u8>, Error>

Source§

fn restore(&mut self, _data: &[u8]) -> Result<(), Error>

Source§

impl<N> Checkpoint for Box<N>
where N: Checkpoint + ?Sized,

Source§

fn checkpoint(&self) -> Result<Vec<u8>, Error>

Source§

fn restore(&mut self, data: &[u8]) -> Result<(), Error>

Source§

impl<T> Checkpoint for Option<T>
where T: Checkpoint,

Source§

fn checkpoint(&self) -> Result<Vec<u8>, Error>

Source§

fn restore(&mut self, _data: &[u8]) -> Result<(), Error>

Implementors§

Source§

impl Checkpoint for dyn Data + 'static

Source§

impl<K, R> Checkpoint for FallbackWSet<K, R>
where K: DataTrait + ?Sized, R: WeightTrait + ?Sized,

Source§

impl<K, R> Checkpoint for VecWSet<K, R>
where K: DataTrait + ?Sized, R: WeightTrait + ?Sized,

Source§

impl<K, V, R> Checkpoint for FallbackIndexedWSet<K, V, R>
where K: DataTrait + ?Sized, V: DataTrait + ?Sized, R: WeightTrait + ?Sized,

Source§

impl<K, V, R> Checkpoint for VecIndexedWSet<K, V, R>
where K: DataTrait + ?Sized, V: DataTrait + ?Sized, R: WeightTrait + ?Sized,

Source§

impl<K, V, R, B> Checkpoint for TypedBatch<K, V, R, B>
where B: Checkpoint, K: DBData, V: DBData, R: DBWeight,

Source§

impl<T1> Checkpoint for Tup1<T1>

Source§

impl<T1, T2> Checkpoint for Tup2<T1, T2>

Source§

impl<T1, T2, T3> Checkpoint for Tup3<T1, T2, T3>
where Tup3<T1, T2, T3>: Serialize<Serializer> + Deserializable,

Source§

impl<T1, T2, T3, T4> Checkpoint for Tup4<T1, T2, T3, T4>
where Tup4<T1, T2, T3, T4>: Serialize<Serializer> + Deserializable,

Source§

impl<T1, T2, T3, T4, T5> Checkpoint for Tup5<T1, T2, T3, T4, T5>
where Tup5<T1, T2, T3, T4, T5>: Serialize<Serializer> + Deserializable,

Source§

impl<T1, T2, T3, T4, T5, T6> Checkpoint for Tup6<T1, T2, T3, T4, T5, T6>
where Tup6<T1, T2, T3, T4, T5, T6>: Serialize<Serializer> + Deserializable,

Source§

impl<T1, T2, T3, T4, T5, T6, T7> Checkpoint for Tup7<T1, T2, T3, T4, T5, T6, T7>
where Tup7<T1, T2, T3, T4, T5, T6, T7>: Serialize<Serializer> + Deserializable,

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> Checkpoint for Tup8<T1, T2, T3, T4, T5, T6, T7, T8>
where Tup8<T1, T2, T3, T4, T5, T6, T7, T8>: Serialize<Serializer> + Deserializable,

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> Checkpoint for Tup9<T1, T2, T3, T4, T5, T6, T7, T8, T9>
where Tup9<T1, T2, T3, T4, T5, T6, T7, T8, T9>: Serialize<Serializer> + Deserializable,

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Checkpoint for Tup10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
where Tup10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>: Serialize<Serializer> + Deserializable,

Source§

impl<T, D: ?Sized> Checkpoint for TypedBox<T, D>