workyard_state/store/
workspace.rs1use super::Store;
2use crate::workspace::Workspace;
3use std::path::Path;
4use workyard_core::Problem;
5
6impl Store {
7 pub(crate) fn state_dir(&self) -> &Path {
8 &self.state
9 }
10
11 pub fn open_existing(state: &Path, requested_root: Option<&Path>) -> Result<Self, Problem> {
13 let workspace = Workspace::open(state, requested_root)?;
14 Ok(Self {
15 root: workspace.root,
16 state: workspace.state,
17 workspace: workspace.gate,
18 })
19 }
20
21 pub fn verify(&self) -> Result<(), Problem> {
23 Workspace::verify(&self.state, &self.root, &self.workspace)
24 }
25}