1
use crate::ast::types::ReturnType;
2
use std::fmt::{Debug, Display};
3

            
4
use serde::{Deserialize, Serialize};
5

            
6
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, Default)]
7
pub struct Metadata {
8
    pub clean: bool,
9
    pub etype: Option<ReturnType>,
10
}
11

            
12
impl Metadata {
13
    pub fn new() -> Metadata {
14
        Metadata {
15
            clean: false,
16
            etype: None,
17
        }
18
    }
19

            
20
    pub fn clone_dirty(&self) -> Metadata {
21
        Metadata {
22
            clean: false,
23
            ..self.clone()
24
        }
25
    }
26
}
27

            
28
impl Display for Metadata {
29
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30
        write!(f, "Metadata")
31
    }
32
}
33

            
34
// impl<T> Display for Metadata<T> where T: for<'a> MetadataKind<'a> {
35
//     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
36
//         write!(f, "Metadata")
37
//     }
38
// }
39

            
40
//
41
// impl<T> Metadata<T> where T: for<'a> MetadataKind<'a> {
42
//     fn new(a: T) -> Metadata<T> {
43
//         Metadata { a }
44
//     }
45
// }