pub trait ToYamlWriter {
fn to_yaml_writer<W>(&self, writer: W) -> Result<(), serde_yaml::Error>
where
W: std::io::Write;
}
impl<T> ToYamlWriter for T
where
T: serde::Serialize + crate::Validate,
{
fn to_yaml_writer<W>(&self, writer: W) -> Result<(), serde_yaml::Error>
where
W: std::io::Write,
{
serde_yaml::to_writer(writer, self)
}
}
impl ToYamlWriter for serde_yaml::Value {
fn to_yaml_writer<W>(&self, writer: W) -> Result<(), serde_yaml::Error>
where
W: std::io::Write,
{
serde_yaml::to_writer(writer, self)
}
}