pub struct AppState {
pub vault_path: Mutex<Option<PathBuf>>,
pub db: Mutex<Option<Connection>>,
pub graph: Mutex<WikiGraph>,
pub watcher: Mutex<Option<Debouncer<RecommendedWatcher>>>,
}Expand description
Application state shared across all consumers (GUI, CLI, MCP).
Each consumer creates and owns its own AppState instance.
The engine does not manage global state — that’s the consumer’s responsibility.
All fields are wrapped in Mutex for thread safety. The struct itself is
Send + Sync (via Mutex), so it can be shared with Arc<AppState>.
Fields§
§vault_path: Mutex<Option<PathBuf>>Path to the currently open vault directory, or None if no vault is open.
db: Mutex<Option<Connection>>SQLite connection to the vault’s .lore/lore.db, or None.
graph: Mutex<WikiGraph>In-memory wiki link graph (nodes = pages, edges = links).
watcher: Mutex<Option<Debouncer<RecommendedWatcher>>>File watcher handle. Drop to stop watching.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AppState
impl RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl UnwindSafe for AppState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more