Skip to main content

ProjectStore

Struct ProjectStore 

Source
pub struct ProjectStore { /* private fields */ }

Implementations§

Source§

impl ProjectStore

Source

pub fn legacy_memory_source_root( &self, legacy_project_key: &str, ) -> ProjectStoreResult<PathBuf>

Physical legacy path-hash scope. This is always read-only.

Source

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.

Source

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.

Source

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.

Source

pub fn project_memory_read_roots( &self, project_id: &ProjectId, ) -> ProjectStoreResult<ProjectMemoryReadRoots>

Source§

impl ProjectStore

Source

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.

Source

pub fn paths(&self) -> &ProjectPaths

Source

pub fn create( &self, name: impl Into<String>, description: Option<String>, ) -> ProjectStoreResult<ProjectManifest>

Source

pub fn create_with_bindings( &self, name: impl Into<String>, description: Option<String>, workspace_bindings: Vec<WorkspaceBinding>, ) -> ProjectStoreResult<ProjectManifest>

Source

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.

Source

pub fn create_with_id( &self, project_id: ProjectId, name: impl Into<String>, description: Option<String>, ) -> ProjectStoreResult<ProjectManifest>

Source

pub fn create_manifest( &self, manifest: ProjectManifest, ) -> ProjectStoreResult<ProjectManifest>

Source

pub fn get(&self, project_id: &ProjectId) -> ProjectStoreResult<ProjectManifest>

Source

pub fn list(&self) -> ProjectStoreResult<Vec<ProjectManifest>>

Source

pub fn index(&self) -> ProjectStoreResult<ProjectIndex>

Source

pub fn update<F>( &self, project_id: &ProjectId, expected_revision: u64, mutate: F, ) -> ProjectStoreResult<ProjectManifest>

CAS update under the per-Project cross-process lock.

Source

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.

Source

pub fn archive( &self, project_id: &ProjectId, expected_revision: u64, ) -> ProjectStoreResult<ProjectManifest>

Source

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.

Source

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.

Source

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.

Source

pub fn bump_resource_revision( &self, project_id: &ProjectId, expected_revision: u64, ) -> ProjectStoreResult<ProjectManifest>

Source

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.

Source

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.

Source

pub fn find_workspace_binding( &self, workspace_path: &str, ) -> ProjectStoreResult<Option<(ProjectManifest, WorkspaceBinding)>>

Source

pub fn resource_summary( &self, project_id: &ProjectId, ) -> ProjectStoreResult<ProjectResourceSummary>

Return only counts/presence and revisions; never read resource contents.

Source

pub fn rebuild_index(&self) -> ProjectStoreResult<ProjectIndex>

Rebuild the derived index from authoritative manifests.

Trait Implementations§

Source§

impl Clone for ProjectStore

Source§

fn clone(&self) -> ProjectStore

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProjectStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more