Skip to main content

SessionStore

Trait SessionStore 

Source
pub trait SessionStore {
    // Required methods
    fn load(&self) -> Session;
    fn save(&self, session: &Session) -> Result<(), FsError>;

    // Provided method
    fn load_with_diagnostics(&self) -> (Session, Vec<SessionDiagnostic>) { ... }
}
Expand description

Service boundary: persist and restore workspace sessions. Widgets and the agent go through this trait, never the OS directly (ARCHITECTURE.md §7.4).

Required Methods§

Source

fn load(&self) -> Session

Load the stored session. A missing or corrupt file yields a default session — losing session state must never stop the editor from starting.

Source

fn save(&self, session: &Session) -> Result<(), FsError>

Persist the session. Returns the error rather than panicking; failing to save recents is a nuisance, not a crash.

Provided Methods§

Source

fn load_with_diagnostics(&self) -> (Session, Vec<SessionDiagnostic>)

Load with the degradation details needed by the application status surface. In-memory stores have no parsing boundary, so their default has no diagnostics.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§