//! The data model shared by all adapters and by the index. use serde::{Deserialize, Serialize}; /// A link from one note to another. Types are optional. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Link { pub dst: String, pub kind: Option, } /// One note. A file is a container of notes; the note is the unit. #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Note { /// `None` for a note that has no ID yet; `check` reports these. pub id: Option, pub path: String, /// Byte span of the note inside its file. pub start: usize, pub end: usize, /// 1-based line number of the first line of the note. pub line: usize, /// Hash of the span, used to detect changed notes. pub hash: String, pub title: String, pub date: Option, pub kind: Option, pub tags: Vec, pub parent: Option, pub links: Vec, pub context: Option, pub summary: Option, /// The text to index. It is never written to the manifest. #[serde(skip)] pub body: String, }