Skip to main content

rightkit_document_workspace/
lib.rs

1//! `rightkit-document-workspace` (Rust side): the persistent store behind a document viewer's
2//! workspace: recent files, pins (files and explorer folders), per-document view state and the
3//! open-tab session, with corruption quarantine and a purge of every stored path.
4//!
5//! The host app chooses the database path and passes it to [`Db::open_path`].
6//!
7//! It also holds the command bodies a viewer app wraps in its IPC layer: [`library`] (recent
8//! files, pins, view state, session), [`document_io`] (read, write, copy, sibling images, file
9//! watching), [`explorer`] (locations, directory listings, folder watches),
10//! [`markdown_resources`] (reference inspection and pasted assets) and [`settings`] (the durable
11//! settings document). The functions are synchronous and return [`WorkspaceError`]. The host
12//! supplies three seams: [`PathGrants`] (which paths the webview may read or write),
13//! [`DocumentBackend`] (format classification and document IO) and [`WorkspaceWatcher`] (OS
14//! watchers). It runs the functions on its blocking pool and keeps its IPC wrappers.
15
16pub mod document_io;
17pub mod documents;
18pub mod error;
19pub mod explorer;
20pub mod grants;
21pub mod library;
22pub mod markdown_index;
23pub mod markdown_resources;
24pub mod settings;
25pub mod store;
26pub mod watch;
27
28pub use documents::{DocumentBackend, FileFingerprint, RawDocument, WriteDocumentResult};
29pub use error::{broker_error, WorkspaceError};
30pub use grants::{authorize_existing_for_read, PathGrants};
31pub use rightkit_db::Degraded;
32pub use store::{Db, FileEntry, PinEntry, ViewState};
33pub use watch::WorkspaceWatcher;