1use serde::{Serialize, Deserialize};
2use super::TagCompact;
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct TagBase {
5 #[serde(flatten)]
6 pub tag_compact: TagCompact,
7 #[serde(skip_serializing_if = "Option::is_none")]
9 pub color: Option<serde_json::Value>,
10 #[serde(skip_serializing_if = "Option::is_none")]
12 pub notes: Option<String>,
13}
14impl std::fmt::Display for TagBase {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16 write!(f, "{}", serde_json::to_string(self).unwrap())
17 }
18}
19impl std::ops::Deref for TagBase {
20 type Target = TagCompact;
21 fn deref(&self) -> &Self::Target {
22 &self.tag_compact
23 }
24}
25impl std::ops::DerefMut for TagBase {
26 fn deref_mut(&mut self) -> &mut Self::Target {
27 &mut self.tag_compact
28 }
29}