1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#[derive(Debug)]
pub struct Document<M = EmptyMetadata> {
    pub page_content: String,
    pub metadata: Option<M>,
}

impl<M> Document<M> {
    pub fn new(page_content: String) -> Self {
        Document {
            page_content,
            metadata: None,
        }
    }
}

#[derive(Debug)]
pub struct EmptyMetadata;

impl From<()> for EmptyMetadata {
    fn from(_: ()) -> Self {
        EmptyMetadata
    }
}