pub struct MetadataStore { /* private fields */ }Implementations§
Source§impl MetadataStore
impl MetadataStore
pub fn at(project_root: impl Into<Utf8PathBuf>) -> Self
pub fn init( project_root: impl Into<Utf8PathBuf>, project_name: &str, source: SourceSubstrate, ) -> Result<Self>
Sourcepub fn discover(cwd: &Utf8Path) -> Result<Context>
pub fn discover(cwd: &Utf8Path) -> Result<Context>
Walk upward from cwd to find the governing metadata. A workspace is
recognized by its gitignored marker and resolves to the store it was
cloned from; a directory with a committed .newgit/config.toml and no
marker is the store itself.
pub fn paths(&self) -> &NewgitPaths
pub fn ensure_initialized(&self) -> Result<()>
pub fn load_config(&self) -> Result<ProjectConfig>
pub fn write_config(&self, config: &ProjectConfig) -> Result<()>
pub fn branch_record_path(&self, slug: &str) -> Utf8PathBuf
Sourcepub fn create_branch_record(
&self,
branch: &BranchInstance,
) -> Result<Utf8PathBuf>
pub fn create_branch_record( &self, branch: &BranchInstance, ) -> Result<Utf8PathBuf>
Write a brand-new binding record; fails on slug collision.
Sourcepub fn save_branch_record(&self, branch: &BranchInstance) -> Result<Utf8PathBuf>
pub fn save_branch_record(&self, branch: &BranchInstance) -> Result<Utf8PathBuf>
Overwrite an existing binding record (e.g. after a tracker capture).
Sourcepub fn load_tracker_definitions(&self) -> Result<Vec<TrackerDefinition>>
pub fn load_tracker_definitions(&self) -> Result<Vec<TrackerDefinition>>
Tracker definitions, one per file in .newgit/trackers/; the name
comes from the filename. Lanes are validated as disjoint.
pub fn create_tracker_definition( &self, definition: &TrackerDefinition, ) -> Result<Utf8PathBuf>
pub fn save_tracker_definition( &self, definition: &TrackerDefinition, ) -> Result<Utf8PathBuf>
Sourcepub fn load_resource_definitions(&self) -> Result<Vec<ResourceDefinition>>
pub fn load_resource_definitions(&self) -> Result<Vec<ResourceDefinition>>
Resource definitions, one per file in .newgit/resources/.
pub fn write_resource_file( &self, name: &str, contents: &str, ) -> Result<Utf8PathBuf>
pub fn instance_state_dir(&self, slug: &str) -> Utf8PathBuf
Sourcepub fn checkpoint_dir(&self, slug: &str) -> Utf8PathBuf
pub fn checkpoint_dir(&self, slug: &str) -> Utf8PathBuf
Per-instance checkpoint records: .newgit/checkpoints/<slug>/.
Sourcepub fn checkpointed_slugs(&self) -> Result<Vec<String>>
pub fn checkpointed_slugs(&self) -> Result<Vec<String>>
Every slug with a checkpoint directory, including instances whose binding record has been archived. Checkpoints outlive removal, so snapshot pruning has to consult all of them, not just live records.
Sourcepub fn state_dirs(&self) -> Result<Vec<Utf8PathBuf>>
pub fn state_dirs(&self) -> Result<Vec<Utf8PathBuf>>
Per-instance runtime state directories that exist on disk.
Sourcepub fn action_log_path(&self, slug: &str, label: &str) -> Utf8PathBuf
pub fn action_log_path(&self, slug: &str, label: &str) -> Utf8PathBuf
Timestamped log path for one action run.
Sourcepub fn append_gitignore(&self, label: &str, patterns: &[String]) -> Result<()>
pub fn append_gitignore(&self, label: &str, patterns: &[String]) -> Result<()>
Append patterns to the store repo’s .gitignore under a labeled block.
pub fn load_branches(&self) -> Result<Vec<BranchInstance>>
Sourcepub fn find_branch(&self, name: &str) -> Result<BranchInstance>
pub fn find_branch(&self, name: &str) -> Result<BranchInstance>
Look an instance up by name or slug.
Sourcepub fn archive_branch_record(
&self,
branch: &BranchInstance,
) -> Result<Utf8PathBuf>
pub fn archive_branch_record( &self, branch: &BranchInstance, ) -> Result<Utf8PathBuf>
The binding record outlives the workspace: removal archives it rather than deleting it.
Trait Implementations§
Source§impl Clone for MetadataStore
impl Clone for MetadataStore
Source§fn clone(&self) -> MetadataStore
fn clone(&self) -> MetadataStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more