1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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())
}
}