Skip to main content

LegacySerializable

Trait LegacySerializable 

Source
pub trait LegacySerializable: Sized {
    // Required methods
    fn from_legacy_json(content: &str) -> Result<Self>;
    fn to_legacy_json(&self) -> Result<String>;
    fn from_legacy_yaml(content: &str) -> Result<Self>;
    fn to_legacy_yaml(&self) -> Result<String>;
    fn from_legacy_toml(content: &str) -> Result<Self>;
    fn to_legacy_toml(&self) -> Result<String>;
}
Expand description

Trait for types that can be converted from legacy formats

Required Methods§

Source

fn from_legacy_json(content: &str) -> Result<Self>

Parse from JSON string

Source

fn to_legacy_json(&self) -> Result<String>

Serialize to JSON string

Source

fn from_legacy_yaml(content: &str) -> Result<Self>

Parse from YAML string

Source

fn to_legacy_yaml(&self) -> Result<String>

Serialize to YAML string

Source

fn from_legacy_toml(content: &str) -> Result<Self>

Parse from TOML string

Source

fn to_legacy_toml(&self) -> Result<String>

Serialize to TOML string

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§