pub struct LocalCoreStateStore { /* private fields */ }Expand description
One journaled private namespace shared by core control-plane state.
Implementations§
Source§impl LocalCoreStateStore
impl LocalCoreStateStore
Sourcepub fn new(root: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>) -> Self
Opens a private companion namespace below root.
Directories are created lazily on first mutation.
Sourcepub async fn materialization_operations_async(
&self,
) -> Result<Vec<OperationId>, LocalCoreStateStoreError>
pub async fn materialization_operations_async( &self, ) -> Result<Vec<OperationId>, LocalCoreStateStoreError>
Lists durable materialization journals without blocking an async executor.
Sourcepub async fn remove_materialization_async(
&self,
operation_id: OperationId,
) -> Result<(), LocalCoreStateStoreError>
pub async fn remove_materialization_async( &self, operation_id: OperationId, ) -> Result<(), LocalCoreStateStoreError>
Removes a terminal journal without blocking an async executor.
Trait Implementations§
Source§impl Clone for LocalCoreStateStore
impl Clone for LocalCoreStateStore
Source§impl Debug for LocalCoreStateStore
impl Debug for LocalCoreStateStore
Source§impl GitCompatStore for LocalCoreStateStore
impl GitCompatStore for LocalCoreStateStore
Source§type Error = LocalCoreStateStoreError
type Error = LocalCoreStateStoreError
Adapter error.
Source§async fn load(
&self,
workspace_id: WorkspaceId,
) -> Result<Option<GitCompatState>, Self::Error>
async fn load( &self, workspace_id: WorkspaceId, ) -> Result<Option<GitCompatState>, Self::Error>
Loads state for one repository/workspace identity.
Source§async fn compare_and_swap(
&self,
workspace_id: WorkspaceId,
expected_revision: u64,
replacement: GitCompatState,
) -> Result<bool, Self::Error>
async fn compare_and_swap( &self, workspace_id: WorkspaceId, expected_revision: u64, replacement: GitCompatState, ) -> Result<bool, Self::Error>
Atomically replaces one expected revision. Revision zero creates state.
Source§async fn compare_and_delete(
&self,
workspace_id: WorkspaceId,
expected_revision: u64,
) -> Result<bool, Self::Error>
async fn compare_and_delete( &self, workspace_id: WorkspaceId, expected_revision: u64, ) -> Result<bool, Self::Error>
Atomically removes one exact compatibility-state revision.
Source§impl LazyWorkspaceStore for LocalCoreStateStore
impl LazyWorkspaceStore for LocalCoreStateStore
Source§type Error = LocalCoreStateStoreError
type Error = LocalCoreStateStoreError
Backend error.
Source§fn load_lazy_workspace<'life0, 'async_trait>(
&'life0 self,
workspace_id: WorkspaceId,
) -> Pin<Box<dyn Future<Output = Result<Option<LazyWorkspaceState>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_lazy_workspace<'life0, 'async_trait>(
&'life0 self,
workspace_id: WorkspaceId,
) -> Pin<Box<dyn Future<Output = Result<Option<LazyWorkspaceState>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads one workspace binding.
Source§fn compare_and_swap_lazy_workspace<'life0, 'async_trait>(
&'life0 self,
workspace_id: WorkspaceId,
expected_revision: u64,
replacement: LazyWorkspaceState,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn compare_and_swap_lazy_workspace<'life0, 'async_trait>(
&'life0 self,
workspace_id: WorkspaceId,
expected_revision: u64,
replacement: LazyWorkspaceState,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Replaces one binding only at the expected revision (
0 means absent).Source§fn load_lazy_overlay<'life0, 'async_trait>(
&'life0 self,
overlay: LazyOverlayId,
) -> Pin<Box<dyn Future<Output = Result<Option<LazyOverlay>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_lazy_overlay<'life0, 'async_trait>(
&'life0 self,
overlay: LazyOverlayId,
) -> Pin<Box<dyn Future<Output = Result<Option<LazyOverlay>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads an immutable content-addressed overlay.
Source§fn put_lazy_overlay<'life0, 'async_trait>(
&'life0 self,
overlay: LazyOverlayId,
value: LazyOverlay,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_lazy_overlay<'life0, 'async_trait>(
&'life0 self,
overlay: LazyOverlayId,
value: LazyOverlay,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores an immutable overlay, idempotently rejecting digest mismatches.
Source§fn load_lazy_shadow<'life0, 'async_trait>(
&'life0 self,
shadow: LazyShadowId,
) -> Pin<Box<dyn Future<Output = Result<Option<LazyShadow>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_lazy_shadow<'life0, 'async_trait>(
&'life0 self,
shadow: LazyShadowId,
) -> Pin<Box<dyn Future<Output = Result<Option<LazyShadow>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads one immutable source-identity shadow node.
Source§fn put_lazy_shadow<'life0, 'async_trait>(
&'life0 self,
shadow: LazyShadowId,
value: LazyShadow,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_lazy_shadow<'life0, 'async_trait>(
&'life0 self,
shadow: LazyShadowId,
value: LazyShadow,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores one immutable source-identity shadow node.
Source§fn load_lazy_workspace_measured<'life0, 'life1, 'async_trait>(
&'life0 self,
workspace_id: WorkspaceId,
budget: WorkBudget,
cancellation: &'life1 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<OperationReceipt<Option<LazyWorkspaceState>>, LazyWorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_lazy_workspace_measured<'life0, 'life1, 'async_trait>(
&'life0 self,
workspace_id: WorkspaceId,
budget: WorkBudget,
cancellation: &'life1 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<OperationReceipt<Option<LazyWorkspaceState>>, LazyWorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads one binding under an explicit logical durable-read budget.
Source§fn compare_and_swap_lazy_workspace_measured<'life0, 'life1, 'async_trait>(
&'life0 self,
workspace_id: WorkspaceId,
expected_revision: u64,
replacement: LazyWorkspaceState,
budget: WorkBudget,
cancellation: &'life1 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<OperationReceipt<bool>, LazyWorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compare_and_swap_lazy_workspace_measured<'life0, 'life1, 'async_trait>(
&'life0 self,
workspace_id: WorkspaceId,
expected_revision: u64,
replacement: LazyWorkspaceState,
budget: WorkBudget,
cancellation: &'life1 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<OperationReceipt<bool>, LazyWorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Replaces one binding under an explicit logical durable-write budget.
Source§fn load_lazy_overlay_measured<'life0, 'life1, 'async_trait>(
&'life0 self,
overlay: LazyOverlayId,
budget: WorkBudget,
cancellation: &'life1 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<OperationReceipt<Option<LazyOverlay>>, LazyWorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_lazy_overlay_measured<'life0, 'life1, 'async_trait>(
&'life0 self,
overlay: LazyOverlayId,
budget: WorkBudget,
cancellation: &'life1 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<OperationReceipt<Option<LazyOverlay>>, LazyWorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads one immutable overlay under an explicit logical read budget.
Source§fn load_lazy_shadow_measured<'life0, 'life1, 'async_trait>(
&'life0 self,
shadow: LazyShadowId,
budget: WorkBudget,
cancellation: &'life1 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<OperationReceipt<Option<LazyShadow>>, LazyWorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_lazy_shadow_measured<'life0, 'life1, 'async_trait>(
&'life0 self,
shadow: LazyShadowId,
budget: WorkBudget,
cancellation: &'life1 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<OperationReceipt<Option<LazyShadow>>, LazyWorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads one immutable shadow under an explicit logical read budget.
Source§impl MaterializationJournalStore for LocalCoreStateStore
impl MaterializationJournalStore for LocalCoreStateStore
Source§type Error = LocalCoreStateStoreError
type Error = LocalCoreStateStoreError
Adapter error.
Source§async fn load(
&self,
operation_id: OperationId,
) -> Result<Option<MaterializationJournal>, Self::Error>
async fn load( &self, operation_id: OperationId, ) -> Result<Option<MaterializationJournal>, Self::Error>
Loads one operation journal.
Source§async fn compare_and_swap(
&self,
operation_id: OperationId,
expected_revision: u64,
replacement: MaterializationJournal,
) -> Result<bool, Self::Error>
async fn compare_and_swap( &self, operation_id: OperationId, expected_revision: u64, replacement: MaterializationJournal, ) -> Result<bool, Self::Error>
Atomically replaces
expected_revision; zero creates a journal.Source§impl MultiRootPublicationStore for LocalCoreStateStore
impl MultiRootPublicationStore for LocalCoreStateStore
Source§type Error = LocalCoreStateStoreError
type Error = LocalCoreStateStoreError
Adapter error.
Source§async fn load(
&self,
operation_id: OperationId,
) -> Result<Option<MultiRootPublication>, Self::Error>
async fn load( &self, operation_id: OperationId, ) -> Result<Option<MultiRootPublication>, Self::Error>
Loads one operation record.
Source§async fn compare_and_swap(
&self,
operation_id: OperationId,
expected_revision: u64,
replacement: MultiRootPublication,
) -> Result<bool, Self::Error>
async fn compare_and_swap( &self, operation_id: OperationId, expected_revision: u64, replacement: MultiRootPublication, ) -> Result<bool, Self::Error>
Atomically replaces one expected revision; zero creates the record.
Source§async fn list_operations(&self) -> Result<Vec<OperationId>, Self::Error>
async fn list_operations(&self) -> Result<Vec<OperationId>, Self::Error>
Lists durable operations that may require restart recovery.
Source§async fn compare_and_delete(
&self,
operation_id: OperationId,
expected_revision: u64,
) -> Result<bool, Self::Error>
async fn compare_and_delete( &self, operation_id: OperationId, expected_revision: u64, ) -> Result<bool, Self::Error>
Removes a terminal record only when its exact revision still matches.
Failed physical cleanup leaves the record intact for restart recovery.
Source§async fn claim_parent(
&self,
parent_context_id: WorkspaceContextId,
operation_id: OperationId,
) -> Result<bool, Self::Error>
async fn claim_parent( &self, parent_context_id: WorkspaceContextId, operation_id: OperationId, ) -> Result<bool, Self::Error>
Atomically claims the one publication slot for a parent context.
Source§async fn release_parent(
&self,
parent_context_id: WorkspaceContextId,
operation_id: OperationId,
) -> Result<bool, Self::Error>
async fn release_parent( &self, parent_context_id: WorkspaceContextId, operation_id: OperationId, ) -> Result<bool, Self::Error>
Releases the exact parent claim after terminal cleanup.
Source§impl WorkspaceContextStore for LocalCoreStateStore
impl WorkspaceContextStore for LocalCoreStateStore
Source§type Error = LocalCoreStateStoreError
type Error = LocalCoreStateStoreError
Adapter error.
Source§async fn load(
&self,
context_id: WorkspaceContextId,
) -> Result<Option<WorkspaceContext>, Self::Error>
async fn load( &self, context_id: WorkspaceContextId, ) -> Result<Option<WorkspaceContext>, Self::Error>
Loads one context, if registered.
Source§async fn list(&self) -> Result<Vec<WorkspaceContext>, Self::Error>
async fn list(&self) -> Result<Vec<WorkspaceContext>, Self::Error>
Lists all durable contexts. Records are small and this is used only for
routing, recursive discard, and recovery—not filesystem indexing.
Source§async fn compare_and_swap(
&self,
context_id: WorkspaceContextId,
expected_revision: u64,
replacement: WorkspaceContext,
) -> Result<bool, Self::Error>
async fn compare_and_swap( &self, context_id: WorkspaceContextId, expected_revision: u64, replacement: WorkspaceContext, ) -> Result<bool, Self::Error>
Atomically replaces
expected_revision; zero creates a context.Source§async fn compare_and_swap_many(
&self,
expected_revisions: BTreeMap<WorkspaceContextId, u64>,
replacements: Vec<WorkspaceContext>,
require_exact_set: bool,
) -> Result<bool, Self::Error>
async fn compare_and_swap_many( &self, expected_revisions: BTreeMap<WorkspaceContextId, u64>, replacements: Vec<WorkspaceContext>, require_exact_set: bool, ) -> Result<bool, Self::Error>
Atomically verifies every listed revision and replaces the supplied
records. Expected revision zero means that context must be absent.
Source§async fn discard_subtree(
&self,
parent: WorkspaceContextId,
child: WorkspaceContextId,
maximum: u32,
) -> Result<WorkspaceContextDiscardOutcome, Self::Error>
async fn discard_subtree( &self, parent: WorkspaceContextId, child: WorkspaceContextId, maximum: u32, ) -> Result<WorkspaceContextDiscardOutcome, Self::Error>
Atomically validates and tombstones one direct-child subtree.
Source§impl WorkspaceLineageStore for LocalCoreStateStore
impl WorkspaceLineageStore for LocalCoreStateStore
Source§type Error = LocalCoreStateStoreError
type Error = LocalCoreStateStoreError
Adapter error.
Source§async fn load(
&self,
workspace_id: WorkspaceId,
) -> Result<Option<WorkspaceLineageRecord>, Self::Error>
async fn load( &self, workspace_id: WorkspaceId, ) -> Result<Option<WorkspaceLineageRecord>, Self::Error>
Loads the record for one workspace, if registered.
Source§async fn compare_and_swap(
&self,
workspace_id: WorkspaceId,
expected_revision: u64,
replacement: WorkspaceLineageRecord,
) -> Result<bool, Self::Error>
async fn compare_and_swap( &self, workspace_id: WorkspaceId, expected_revision: u64, replacement: WorkspaceLineageRecord, ) -> Result<bool, Self::Error>
Atomically replaces
expected_revision; zero creates a record.Auto Trait Implementations§
impl Freeze for LocalCoreStateStore
impl RefUnwindSafe for LocalCoreStateStore
impl Send for LocalCoreStateStore
impl Sync for LocalCoreStateStore
impl Unpin for LocalCoreStateStore
impl UnsafeUnpin for LocalCoreStateStore
impl UnwindSafe for LocalCoreStateStore
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request