1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#[derive(Clone, Debug, PartialEq)]
pub enum Patch {
Json(Vec<serde_json::Value>),
Merge(serde_json::Value),
StrategicMerge(serde_json::Value),
}
impl serde::Serialize for Patch {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
match self {
Patch::Json(patch) => serializer.serialize_newtype_struct("Patch", patch),
Patch::Merge(patch) |
Patch::StrategicMerge(patch) => serializer.serialize_newtype_struct("Patch", patch),
}
}
}