pub trait TextCodec {
type Options: Default;
// Required methods
fn serialize(model: &Model, options: &Self::Options) -> Result<String>;
fn deserialize(source: &str) -> Result<Model>;
}Expand description
A textual serialization format for Model.
Binary protobuf file I/O remains separate because it also manages paths, external weights, and file-format detection.
Required Associated Types§
Required Methods§
Sourcefn serialize(model: &Model, options: &Self::Options) -> Result<String>
fn serialize(model: &Model, options: &Self::Options) -> Result<String>
Serialize model with explicit format options.
Sourcefn deserialize(source: &str) -> Result<Model>
fn deserialize(source: &str) -> Result<Model>
Deserialize a model from this format.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".