(raw: Option<&str>)
| 13 | |
| 14 | impl TaskMetadata { |
| 15 | pub fn parse(raw: Option<&str>) -> Result<Self, serde_json::Error> { |
| 16 | raw.map(serde_json::from_str) |
| 17 | .transpose() |
| 18 | .map(Option::unwrap_or_default) |
| 19 | } |
| 20 | |
| 21 | pub fn to_json(&self) -> Option<String> { |
| 22 | if self.ordered_sequence_started.is_none() && self.extra.is_empty() { |
no outgoing calls