Skip to main content

StudyIo

Trait StudyIo 

Source
pub trait StudyIo: Sized {
    // Required methods
    fn save(&self, path: impl AsRef<Path>) -> Result<()>;
    fn load(path: impl AsRef<Path>) -> Result<Self>;
}
Expand description

Persist a Study as JSON.

Required Methods§

Source

fn save(&self, path: impl AsRef<Path>) -> Result<()>

Serialize to pretty JSON at path.

Source

fn load(path: impl AsRef<Path>) -> Result<Self>

Load a study previously written by save — or by a tracker’s study.json, which is the same format.

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 StudyIo for Study

Source§

fn save(&self, path: impl AsRef<Path>) -> Result<()>

Source§

fn load(path: impl AsRef<Path>) -> Result<Self>

Implementors§