pub struct Store { /* private fields */ }Expand description
A handle to a .wipe board rooted at a project directory.
Implementations§
Source§impl Store
impl Store
Sourcepub fn media_dir(&self) -> PathBuf
pub fn media_dir(&self) -> PathBuf
Path to the media directory (version-controlled attachments).
Sourcepub fn open(root: impl AsRef<Path>) -> Result<Self>
pub fn open(root: impl AsRef<Path>) -> Result<Self>
Open an existing board rooted exactly at root (which must contain .wipe).
Sourcepub fn discover(start: impl AsRef<Path>) -> Result<Self>
pub fn discover(start: impl AsRef<Path>) -> Result<Self>
Discover the board by walking up from start until a .wipe directory is
found, mirroring how git locates its repository root.
Sourcepub fn init(
root: impl AsRef<Path>,
name: &str,
now: DateTime<Utc>,
) -> Result<Self>
pub fn init( root: impl AsRef<Path>, name: &str, now: DateTime<Utc>, ) -> Result<Self>
Initialize a brand-new board under root with the default (standard)
starter content. Fails with Error::AlreadyInitialized if a .wipe
directory already exists.
Sourcepub fn init_with(
root: impl AsRef<Path>,
name: &str,
now: DateTime<Utc>,
starter: Starter,
) -> Result<Self>
pub fn init_with( root: impl AsRef<Path>, name: &str, now: DateTime<Utc>, starter: Starter, ) -> Result<Self>
Initialize a brand-new board, choosing how much starter content to seed: standard lists+labels, lists only, or a blank board.
Sourcepub fn load_board(&self) -> Result<Board>
pub fn load_board(&self) -> Result<Board>
Load board.json.
Sourcepub fn save_board(&self, board: &Board) -> Result<()>
pub fn save_board(&self, board: &Board) -> Result<()>
Write board.json deterministically and atomically.
Sourcepub fn load_definitions(&self) -> Result<Definitions>
pub fn load_definitions(&self) -> Result<Definitions>
Load definitions.json.
Sourcepub fn save_definitions(&self, defs: &Definitions) -> Result<()>
pub fn save_definitions(&self, defs: &Definitions) -> Result<()>
Write definitions.json.
Sourcepub fn load_settings(&self) -> Result<Settings>
pub fn load_settings(&self) -> Result<Settings>
Load settings.json.
Sourcepub fn save_settings(&self, settings: &Settings) -> Result<()>
pub fn save_settings(&self, settings: &Settings) -> Result<()>
Write settings.json.
Sourcepub fn load_identities(&self) -> Result<Vec<Identity>>
pub fn load_identities(&self) -> Result<Vec<Identity>>
Load identities.json (empty if the file doesn’t exist yet).
Sourcepub fn save_identities(&self, identities: &[Identity]) -> Result<()>
pub fn save_identities(&self, identities: &[Identity]) -> Result<()>
Write identities.json.
Sourcepub fn load_ticket(&self, id: &str) -> Result<Ticket>
pub fn load_ticket(&self, id: &str) -> Result<Ticket>
Load a single ticket by ID.
Sourcepub fn save_ticket(&self, ticket: &Ticket) -> Result<()>
pub fn save_ticket(&self, ticket: &Ticket) -> Result<()>
Write a ticket file.
Sourcepub fn delete_ticket(&self, id: &str) -> Result<()>
pub fn delete_ticket(&self, id: &str) -> Result<()>
Delete a ticket file. Errors if it does not exist.
Sourcepub fn ticket_ids(&self) -> Result<Vec<String>>
pub fn ticket_ids(&self) -> Result<Vec<String>>
Return all ticket IDs currently on disk, sorted numerically by counter.
Sourcepub fn load_all_tickets(&self) -> Result<Vec<Ticket>>
pub fn load_all_tickets(&self) -> Result<Vec<Ticket>>
Load every ticket on disk, ordered by ID counter.
Sourcepub fn thread_exists(&self, thread_id: &str) -> bool
pub fn thread_exists(&self, thread_id: &str) -> bool
Whether a thread file already exists on disk for thread_id.
Sourcepub fn load_thread(&self, thread_id: &str) -> Result<Thread>
pub fn load_thread(&self, thread_id: &str) -> Result<Thread>
Load a forum thread by its thread ID (e.g. F-1).
Sourcepub fn save_thread(&self, thread: &Thread) -> Result<()>
pub fn save_thread(&self, thread: &Thread) -> Result<()>
Write a forum thread file.
Sourcepub fn delete_thread(&self, thread_id: &str) -> Result<()>
pub fn delete_thread(&self, thread_id: &str) -> Result<()>
Delete a forum thread file. Errors if it does not exist.
Sourcepub fn thread_ids(&self) -> Result<Vec<String>>
pub fn thread_ids(&self) -> Result<Vec<String>>
All forum thread IDs on disk, sorted numerically by counter.
Sourcepub fn load_all_threads(&self) -> Result<Vec<Thread>>
pub fn load_all_threads(&self) -> Result<Vec<Thread>>
Load every forum thread on disk, ordered by ID counter.