Expand description
rightkit-document-workspace (Rust side): the persistent store behind a document viewer’s
workspace: recent files, pins (files and explorer folders), per-document view state and the
open-tab session, with corruption quarantine and a purge of every stored path.
The host app chooses the database path and passes it to Db::open_path.
It also holds the command bodies a viewer app wraps in its IPC layer: library (recent
files, pins, view state, session), document_io (read, write, copy, sibling images, file
watching), explorer (locations, directory listings, folder watches),
markdown_resources (reference inspection and pasted assets) and settings (the durable
settings document). The functions are synchronous and return WorkspaceError. The host
supplies three seams: PathGrants (which paths the webview may read or write),
DocumentBackend (format classification and document IO) and WorkspaceWatcher (OS
watchers). It runs the functions on its blocking pool and keeps its IPC wrappers.
Re-exports§
pub use documents::DocumentBackend;pub use documents::FileFingerprint;pub use documents::RawDocument;pub use documents::WriteDocumentResult;pub use error::broker_error;pub use error::WorkspaceError;pub use grants::PathGrants;pub use store::Db;pub use store::FileEntry;pub use store::PinEntry;pub use store::ViewState;pub use watch::WorkspaceWatcher;
Modules§
- document_
io - Document read/write/copy, sibling-image listing and file watching, with the grant checks the commands apply. Every function is synchronous; the host runs them off its IPC thread.
- documents
- Document types and the backend seam. The host supplies format classification and the actual
document reads and writes (encoding detection, atomic writes) through
DocumentBackend. - error
- Typed error envelope for workspace command failures.
- explorer
- Backend for the explorer sidebar: system locations, one-level directory listings, per-folder change watches, and OS-level reveal.
- grants
- The path-grant seam. The host app owns which paths the webview may read or write; the
workspace functions only ask it questions through
PathGrants. - library
- Recent files, pins, per-document view state and the tab session, with the broker rules the
commands apply on top of the
Dbstore. - markdown_
index - Markdown folder index: the Markdown files beside a document, with titles, for a link picker or completion provider. Hard caps: 1 000 files, 20 MiB total, 2 MiB per file, depth 8.
- markdown_
resources - Markdown reference inspection and pasted-asset staging (save, commit, roll back). Every function is synchronous; the host runs them off its IPC thread.
- settings
- The durable settings document and the explorer record, stored as
rightkit-app-settingsenvelopes under<data_dir>/<namespace>/. - store
- The document workspace store: recent files, pinned files and folders, per-document view state and the open-tab session, in one SQLite file the host app places.
- watch
- The file-watch seam. The host owns the OS watchers and the event channel to the renderer; the workspace only decides which paths to watch.
Structs§
- Degraded
- Why
DbOptions::open_writer_migrated_or_degradedid not use the stored database as-is.