Skip to main content

CanvasStore

Trait CanvasStore 

Source
pub trait CanvasStore: Send + Sync {
    // Required methods
    fn load(&self) -> Option<Canvas>;
    fn save(&mut self, canvas: &Canvas);
}
Expand description

Persistence boundary for the canonical canvas. In-memory by default; the late-sh integration plan describes a postgres-backed impl.

Required Methods§

Source

fn load(&self) -> Option<Canvas>

Called on server startup. Return the canvas to initialize with, or None for a fresh empty canvas.

Source

fn save(&mut self, canvas: &Canvas)

Called after every applied op. Implementations may debounce or skip.

Implementors§