calternal_plugin_notes::canvas_text
Checked Note/Task text synchronization for linked Canvas drawings (#977, §60). The authenticated editor supplies authority for the item. Canvas ownership grants no item access. Compare title and prose under the Notes writer lock; preserve properties, workflow state and the generated element backlink.
Source: crates/plugins/notes/src/canvas_text.rs
Structs
Section titled “Structs”CanvasItemText
Section titled “CanvasItemText”pub struct CanvasItemTextAuthorized drawing text. This projection is never an authorization token.
Fields
pub owner: Stringpub path: Stringpub title: Stringpub body: Stringpub editable: boolpub status: Option<String>: Task workflow state remains separate from title and prose.
Implements: Clone, Debug
Source: crates/plugins/notes/src/canvas_text.rs:22
CanvasTextWrite
Section titled “CanvasTextWrite”pub struct CanvasTextWriteA durable item save supplies the Files adapter with its original identity.
Fields
pub owner: Stringpub path: Stringpub before: FileFingerprint
Source: crates/plugins/notes/src/canvas_text.rs:33
CanvasTextAccess
Section titled “CanvasTextAccess”pub enum CanvasTextAccessCurrent security-state result; callers must resolve this again before writes.
Variants
DeniedViewerEditor
Implements: Clone, Copy, PartialEq, Eq
Source: crates/plugins/notes/src/canvas_text.rs:14
Functions
Section titled “Functions”pub async fn read<F, Fut>( root: &Root, db: &Db, author: &str, link: &str, authorize: F,) -> Result<CanvasItemText>where F: Fn(String, String) -> Fut, Fut: Future<Output = CanvasTextAccess>,Read under the editing User’s current grant. The owner shortcut belongs to the item owner, never the owner of the Canvas containing the link (#977).
Source: crates/plugins/notes/src/canvas_text.rs:114
pub async fn sync<F, Fut>( root: &Root, db: &Db, author: &str, link: &str, before: &str, after: &str, authorize: F,) -> Result<Option<CanvasTextWrite>>where F: Fn(String, String) -> Fut, Fut: Future<Output = CanvasTextAccess>,Compare drawing text with the current item while holding its writer lock. A matching projection is a read-only refresh, not an item write. Recheck the edit grant after the baseline read so revocation during an edit fails closed.