Trait lef21::SerdeFile[][src]

pub trait SerdeFile: Serialize + DeserializeOwned {
    fn save(
        &self,
        fmt: SerializationFormat,
        fname: impl AsRef<Path>
    ) -> Result<(), Error> { ... }
fn open(
        fname: impl AsRef<Path>,
        fmt: SerializationFormat
    ) -> Result<Self, Error> { ... } }
Expand description

Serialization to & from file trait

Includes:

  • open for loading from file
  • save for saving to file

Fully default-implemented, allowing empty implementations for types that implement serde serialization and deserialization.

Provided methods

Save in fmt-format to file fname

Open from fmt-format file fname

Implementors