cu29::cutask

Trait Freezable

source
pub trait Freezable {
    // Provided methods
    fn freeze<E: Encoder>(&self, encoder: &mut E) -> Result<(), EncodeError> { ... }
    fn thaw<D: Decoder>(&mut self, decoder: &mut D) -> Result<(), DecodeError> { ... }
}
Expand description

The internal state of a task needs to be serializable so the framework can take a snapshop of the task graph.

Provided Methods§

source

fn freeze<E: Encoder>(&self, encoder: &mut E) -> Result<(), EncodeError>

This method is called by the framework when it wants to save the task state. The default implementation is to encode nothing (stateless). If you have a state, you need to implement this method.

source

fn thaw<D: Decoder>(&mut self, decoder: &mut D) -> Result<(), DecodeError>

This method is called by the framework when it wants to restore the task to a specific state. Here it is similar to Decode but the framework will give you a new instance of the task (the new method will be called)

Object Safety§

This trait is not object safe.

Implementors§