Skip to main content

lore_engine/
types.rs

1use serde::Serialize;
2
3/// Full page data returned when loading a page for editing/viewing.
4#[derive(Debug, Serialize)]
5pub struct PageData {
6    pub slug: String,
7    pub title: String,
8    pub content: String,
9    pub backlinks: Vec<BacklinkEntry>,
10    pub is_placeholder: bool,
11}
12
13/// A single backlink entry (page that links to the current page).
14#[derive(Debug, Serialize)]
15pub struct BacklinkEntry {
16    pub slug: String,
17    pub title: String,
18}
19
20/// A page list entry for the sidebar tree.
21#[derive(Debug, Serialize)]
22pub struct PageListEntry {
23    pub slug: String,
24    pub title: String,
25    pub is_placeholder: bool,
26    pub file_path: Option<String>,
27}
28
29/// Vault metadata returned after opening a vault.
30#[derive(Debug, Serialize)]
31pub struct VaultInfo {
32    pub path: String,
33    pub page_count: usize,
34    pub link_count: usize,
35}