use chrono::{DateTime, Utc}; use sqlx::{self, FromRow}; // // A Resource is either content or a URL to content that the // // user embeds in a note. TODO: I have no idea how to do this yet, // // but I'll figure it out. // #[derive(Clone, Serialize, Deserialize, Debug)] // pub struct Resource { // pub id: String, // pub content: String, // } // // // A Breadcrumb is a component of a reference. Every element should // // be clickable, although in practice what's going to happen is that // // the user will be sent to the *page* with that note, then *scrolled* // // to that note via anchor. // #[derive(Clone, Debug)] // pub struct Breadcrumb { // pub note_id: String, // pub summary: String, // } // // // A Note is the heart of our system. It is a single object that has // // a place in our system; it has a parent, but it also has embedded // // references that allow it to navigate through a web of related // // objects. It may have children. *AT THIS LAYER*, though, it is // // returned as an array. It is up to the // #[derive(Clone, Debug)] // pub struct Note { // pub id: String, // pub parent_id: String, // pub content: String, // pub resources: Vec, // pub note_type: String, // Describes the relationship to the parent note. // pub created: DateTime, // pub updated: DateTime, // pub viewed: DateTime, // pub deleted: Option>, // } // // pub struct Reference { // pub page_id: String, // pub page_title: String, // pub reference_summary_titles: Vec, // pub reference_summary: String, // } pub struct Page { pub slug: String, pub title: String, // pub notes: Vec, // The actual notes on this page. // pub references: Vec, // All other notes that reference this page. // pub unlinked_references: Vec, pub created: DateTime, pub updated: DateTime, pub viewed: DateTime, pub deleted: Option>, }