Trait State

Source
pub trait State<P: Plugin> {
    // Required methods
    fn save(plugin: &P, stream: &mut OStream) -> Result<(), Error>;
    fn load(plugin: &P, stream: &mut IStream) -> Result<(), Error>;
}

Required Methods§

Source

fn save(plugin: &P, stream: &mut OStream) -> Result<(), Error>

Saves the plugin state into stream.

§Return

Returns Ok if the state was correctly saved.

Source

fn load(plugin: &P, stream: &mut IStream) -> Result<(), Error>

Loads the plugin state from stream.

§Return

Returns Ok if the state was correctly restored.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<P: Plugin> State<P> for ()

Source§

fn save(_: &P, _: &mut OStream) -> Result<(), Error>

Source§

fn load(_: &P, _: &mut IStream) -> Result<(), Error>

Implementors§