pub struct Project {
pub root: PathBuf,
pub base: PathBuf,
pub pcfg: ProjectConfig,
}Fields§
§root: PathBuf§base: PathBuf§pcfg: ProjectConfigThe universal engine config (<root>/opys.toml), the sole source of
truth for document types, statuses, fields, sections, and rules.
Implementations§
Source§impl Project
impl Project
Sourcepub fn open(root: &str) -> Result<Project>
pub fn open(root: &str) -> Result<Project>
Open the project by searching upward from root (default the cwd) for
opys.toml. The directory holding it is the project root; the inventory
base is <root>/<config.base> (default opys).
Sourcepub fn doc_path(&self, id: &str, status: &str) -> PathBuf
pub fn doc_path(&self, id: &str, status: &str) -> PathBuf
The canonical on-disk path for a document with the given id and status,
per the configured layout (see ProjectConfig::doc_relpath).
Sourcepub fn max_doc_id(&self, docs: &[Doc]) -> u64
pub fn max_doc_id(&self, docs: &[Doc]) -> u64
Highest numeric id part across a document set, their relation maps, and the retired ledger — the basis for the single global, monotonically increasing id sequence shared by every type.
Sourcepub fn next_id_for(&self, prefix: &str, docs: &[Doc]) -> String
pub fn next_id_for(&self, prefix: &str, docs: &[Doc]) -> String
Next id for a type prefix: one past the global max, padded to pcfg.pad.
Sourcepub fn retired_ids(&self) -> HashSet<String>
pub fn retired_ids(&self) -> HashSet<String>
IDs that have been retired and may never be reused.
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin for Project
impl UnwindSafe for Project
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more