pub struct ProjectStore { /* private fields */ }Implementations§
Source§impl ProjectStore
impl ProjectStore
Sourcepub fn legacy_memory_source_root(
&self,
legacy_project_key: &str,
) -> ProjectStoreResult<PathBuf>
pub fn legacy_memory_source_root( &self, legacy_project_key: &str, ) -> ProjectStoreResult<PathBuf>
Physical legacy path-hash scope. This is always read-only.
Sourcepub fn migrate_legacy_memory(
&self,
project_id: &ProjectId,
legacy_project_key: &str,
) -> ProjectStoreResult<LegacyMemoryMigrationReport>
pub fn migrate_legacy_memory( &self, project_id: &ProjectId, legacy_project_key: &str, ) -> ProjectStoreResult<LegacyMemoryMigrationReport>
Copy a declared legacy scope into
${BAMBOO_DATA_DIR}/projects/<id>/memory/v1.
Sourcepub fn legacy_memory_migration_status(
&self,
project_id: &ProjectId,
legacy_project_key: &str,
) -> ProjectStoreResult<Option<LegacyMemoryMigrationReport>>
pub fn legacy_memory_migration_status( &self, project_id: &ProjectId, legacy_project_key: &str, ) -> ProjectStoreResult<Option<LegacyMemoryMigrationReport>>
Return a durable in-progress/committed journal, if one exists.
Sourcepub fn legacy_memory_aliases(
&self,
project_id: &ProjectId,
) -> ProjectStoreResult<Vec<LegacyMemoryReadAlias>>
pub fn legacy_memory_aliases( &self, project_id: &ProjectId, ) -> ProjectStoreResult<Vec<LegacyMemoryReadAlias>>
Alias metadata for every manifest-declared legacy key.
Aliases are active during and after migration. Runtime readers must search Project-home first and use available legacy roots only as read-only fallbacks.
pub fn project_memory_read_roots( &self, project_id: &ProjectId, ) -> ProjectStoreResult<ProjectMemoryReadRoots>
Source§impl ProjectStore
impl ProjectStore
Sourcepub fn open(data_dir: impl Into<PathBuf>) -> ProjectStoreResult<Self>
pub fn open(data_dir: impl Into<PathBuf>) -> ProjectStoreResult<Self>
Open the registry and rebuild its derived index. Corrupt individual manifests are recovered from their last-known-good backup when possible; otherwise they are quarantined and skipped rather than blocking startup.
pub fn paths(&self) -> &ProjectPaths
pub fn create( &self, name: impl Into<String>, description: Option<String>, ) -> ProjectStoreResult<ProjectManifest>
pub fn create_with_bindings( &self, name: impl Into<String>, description: Option<String>, workspace_bindings: Vec<WorkspaceBinding>, ) -> ProjectStoreResult<ProjectManifest>
Sourcepub fn create_with_project_path(
&self,
name: impl Into<String>,
description: Option<String>,
project_path: impl Into<String>,
workspace_bindings: Vec<WorkspaceBinding>,
) -> ProjectStoreResult<ProjectManifest>
pub fn create_with_project_path( &self, name: impl Into<String>, description: Option<String>, project_path: impl Into<String>, workspace_bindings: Vec<WorkspaceBinding>, ) -> ProjectStoreResult<ProjectManifest>
Create a configured active Project with one authoritative user source folder plus zero or more additional workspaces/worktrees.
pub fn create_with_id( &self, project_id: ProjectId, name: impl Into<String>, description: Option<String>, ) -> ProjectStoreResult<ProjectManifest>
pub fn create_manifest( &self, manifest: ProjectManifest, ) -> ProjectStoreResult<ProjectManifest>
pub fn get(&self, project_id: &ProjectId) -> ProjectStoreResult<ProjectManifest>
pub fn list(&self) -> ProjectStoreResult<Vec<ProjectManifest>>
pub fn index(&self) -> ProjectStoreResult<ProjectIndex>
Sourcepub fn update<F>(
&self,
project_id: &ProjectId,
expected_revision: u64,
mutate: F,
) -> ProjectStoreResult<ProjectManifest>
pub fn update<F>( &self, project_id: &ProjectId, expected_revision: u64, mutate: F, ) -> ProjectStoreResult<ProjectManifest>
CAS update under the per-Project cross-process lock.
Sourcepub fn update_with_project_path<F>(
&self,
project_id: &ProjectId,
expected_revision: u64,
project_path: &str,
mutate: F,
) -> ProjectStoreResult<ProjectManifest>
pub fn update_with_project_path<F>( &self, project_id: &ProjectId, expected_revision: u64, project_path: &str, mutate: F, ) -> ProjectStoreResult<ProjectManifest>
Atomically update the authoritative Project path and other metadata under the registry lock. The new path is canonicalized and checked against every Project root before the CAS write becomes visible.
pub fn archive( &self, project_id: &ProjectId, expected_revision: u64, ) -> ProjectStoreResult<ProjectManifest>
Sourcepub fn unarchive(
&self,
project_id: &ProjectId,
expected_revision: u64,
) -> ProjectStoreResult<ProjectManifest>
pub fn unarchive( &self, project_id: &ProjectId, expected_revision: u64, ) -> ProjectStoreResult<ProjectManifest>
Restore an archived Project under the same per-Project CAS lock used by every manifest mutation. The status check is intentionally performed inside the update closure so two concurrent restores cannot both succeed.
Sourcepub fn bind_workspace(
&self,
project_id: &ProjectId,
expected_revision: u64,
binding: WorkspaceBinding,
) -> ProjectStoreResult<ProjectManifest>
pub fn bind_workspace( &self, project_id: &ProjectId, expected_revision: u64, binding: WorkspaceBinding, ) -> ProjectStoreResult<ProjectManifest>
Register an exact canonical workspace path under a registry-wide lock. A path already owned by another Project is rejected.
Sourcepub fn unbind_workspace(
&self,
project_id: &ProjectId,
expected_revision: u64,
workspace_path: &str,
) -> ProjectStoreResult<ProjectManifest>
pub fn unbind_workspace( &self, project_id: &ProjectId, expected_revision: u64, workspace_path: &str, ) -> ProjectStoreResult<ProjectManifest>
Remove only the exact binding; no session or Project resource is deleted or moved.
pub fn bump_resource_revision( &self, project_id: &ProjectId, expected_revision: u64, ) -> ProjectStoreResult<ProjectManifest>
Sourcepub fn find_workspace_owner(
&self,
workspace_path: &str,
) -> ProjectStoreResult<Option<ProjectManifest>>
pub fn find_workspace_owner( &self, workspace_path: &str, ) -> ProjectStoreResult<Option<ProjectManifest>>
Resolve an exact registered workspace owner. Multiple owners are a corrupt/ambiguous registry state and return a validation error.
Sourcepub fn find_workspace_owner_for_path(
&self,
candidate_path: &str,
) -> ProjectStoreResult<Option<ProjectManifest>>
pub fn find_workspace_owner_for_path( &self, candidate_path: &str, ) -> ProjectStoreResult<Option<ProjectManifest>>
Resolve the owner of an existing candidate path using component-aware containment below registered canonical workspace bindings.
A candidate that is equal to a binding or is a descendant of one matches. If nested bindings make more than one Project match, resolution fails closed instead of picking the longest prefix or registry order.
pub fn find_workspace_binding( &self, workspace_path: &str, ) -> ProjectStoreResult<Option<(ProjectManifest, WorkspaceBinding)>>
Sourcepub fn resource_summary(
&self,
project_id: &ProjectId,
) -> ProjectStoreResult<ProjectResourceSummary>
pub fn resource_summary( &self, project_id: &ProjectId, ) -> ProjectStoreResult<ProjectResourceSummary>
Return only counts/presence and revisions; never read resource contents.
Sourcepub fn rebuild_index(&self) -> ProjectStoreResult<ProjectIndex>
pub fn rebuild_index(&self) -> ProjectStoreResult<ProjectIndex>
Rebuild the derived index from authoritative manifests.
Trait Implementations§
Source§impl Clone for ProjectStore
impl Clone for ProjectStore
Source§fn clone(&self) -> ProjectStore
fn clone(&self) -> ProjectStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more