pub trait ToYaml {
// Provided methods
fn try_to_yaml_value(&self) -> Result<YamlValue>
where Self: Serialize { ... }
fn try_from_yaml_value(value: YamlValue) -> Result<Self>
where Self: DeserializeOwned { ... }
fn to_yaml_value(&self) -> YamlValue
where Self: Serialize { ... }
fn from_yaml_value(value: YamlValue) -> Self
where Self: DeserializeOwned { ... }
fn try_to_yaml(&self) -> Result<String>
where Self: Serialize { ... }
fn try_to_yaml_into(&self, writer: impl Write) -> Result<()>
where Self: Serialize { ... }
fn try_from_yaml(yaml: impl AsBytes) -> Result<Self>
where Self: DeserializeOwned { ... }
fn try_from_yaml_from(reader: impl Read) -> Result<Self>
where Self: DeserializeOwned { ... }
fn to_yaml(&self) -> String
where Self: Serialize { ... }
fn to_yaml_into(&self, writer: impl Write)
where Self: Serialize { ... }
fn from_yaml(yaml: impl AsBytes) -> Self
where Self: DeserializeOwned { ... }
fn from_yaml_from(reader: impl Read) -> Self
where Self: DeserializeOwned { ... }
}
Expand description
§A trait that can de/encode to/from yaml.
Provided Methods§
fn try_to_yaml_value(&self) -> Result<YamlValue>where
Self: Serialize,
fn try_from_yaml_value(value: YamlValue) -> Result<Self>where
Self: DeserializeOwned,
fn to_yaml_value(&self) -> YamlValuewhere
Self: Serialize,
fn from_yaml_value(value: YamlValue) -> Selfwhere
Self: DeserializeOwned,
fn try_to_yaml(&self) -> Result<String>where
Self: Serialize,
fn try_to_yaml_into(&self, writer: impl Write) -> Result<()>where
Self: Serialize,
fn try_from_yaml(yaml: impl AsBytes) -> Result<Self>where
Self: DeserializeOwned,
fn try_from_yaml_from(reader: impl Read) -> Result<Self>where
Self: DeserializeOwned,
fn to_yaml(&self) -> Stringwhere
Self: Serialize,
fn to_yaml_into(&self, writer: impl Write)where
Self: Serialize,
fn from_yaml(yaml: impl AsBytes) -> Selfwhere
Self: DeserializeOwned,
fn from_yaml_from(reader: impl Read) -> Selfwhere
Self: DeserializeOwned,
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.