drawbridge_type/tree/
entry.rs

1// SPDX-License-Identifier: Apache-2.0
2
3use super::super::Meta;
4
5use std::collections::HashMap;
6
7use serde::{Deserialize, Serialize};
8use serde_json::Value;
9
10/// A directory entry
11///
12/// Note that this type is designed to be extensible. Therefore, the fields
13/// here represent the minimum required fields. Other fields may be present.
14#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
15pub struct Entry<C: ?Sized = ()> {
16    /// The metadata of this entry
17    #[serde(flatten)]
18    pub meta: Meta,
19
20    /// Custom fields
21    #[serde(flatten)]
22    pub custom: HashMap<String, Value>,
23
24    #[serde(skip)]
25    pub content: C,
26}
27
28impl<C> Entry<C> {
29    pub const TYPE: &'static str = "application/vnd.drawbridge.entry.v1+json";
30}