use holochain_serialized_bytes::prelude::*;
#[derive(
Debug,
Clone,
PartialEq,
Eq,
derive_more::From,
serde::Serialize,
serde::Deserialize,
SerializedBytes,
)]
pub struct YamlProperties(serde_yaml::Value);
impl YamlProperties {
pub fn new(properties: serde_yaml::Value) -> Self {
Self(properties)
}
pub fn empty() -> Self {
Self(serde_yaml::Value::Null)
}
}
impl From<()> for YamlProperties {
fn from(_: ()) -> Self {
Self::empty()
}
}
impl Default for YamlProperties {
fn default() -> Self {
Self::empty()
}
}
#[cfg(feature = "arbitrary")]
impl<'a> arbitrary::Arbitrary<'a> for YamlProperties {
fn arbitrary(_: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
Ok(serde_yaml::Value::Null.into())
}
}