Trait Note

Source
pub trait Note<T: NoteType>: Debug {
    // Required methods
    fn get_title(&self) -> String;
    fn get_note_inner(&self) -> T;
    fn get_id(&self) -> NoteID;
    fn get_revision(&self) -> Revision;
    fn get_parent(&self) -> Option<NoteID>;
    fn get_branches(&self) -> HashSet<NoteID>;
    fn get_prev(&self) -> Option<NoteID>;
    fn get_next(&self) -> Option<NoteID>;
    fn get_references(&self) -> HashSet<NoteID>;
    fn get_referents(&self) -> HashSet<NoteID>;
    fn get_metadata(&self) -> NoteMetadata;
    fn is_current(&self) -> bool;
}
Expand description

Represent a complete note entity for downstream consumption

Note properties can be stored as is by the storage backend, but can also be computed. Expensive computation can be cached, but it’s the storage’s responsibility to keep the cache coherent.

Revision properties (title, note_inner, id, revision, referents, metadata) are immutable for a given revision.

Note properties (parent, branches, prev, next, references) reflect the current global view of a note store, and relationship between notes (which are represented by their respective latest revision).

Helper properties (is_current) reflects the status of the revision with respect to the note

Required Methods§

Implementors§