Skip to main content

MultiRootPublisher

Trait MultiRootPublisher 

Source
pub trait MultiRootPublisher: Send + Sync {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn prepare(
        &self,
        operation_id: OperationId,
        root_id: WorkspaceRootId,
        root: &MultiRootMergeRoot,
        resolutions: &BTreeMap<ConflictKey, MergeResolution>,
    ) -> impl Future<Output = Result<MultiRootPrepare, Self::Error>> + StorageFuture;
    fn release(
        &self,
        operation_id: OperationId,
        root_id: WorkspaceRootId,
        fence: &MultiRootFence,
    ) -> impl Future<Output = Result<(), Self::Error>> + StorageFuture;
    fn project_conflict(
        &self,
        operation_id: OperationId,
        root_id: WorkspaceRootId,
        root: &MultiRootMergeRoot,
        conflict: Option<&MergePlan>,
    ) -> impl Future<Output = Result<GenerationId, Self::Error>> + StorageFuture;
    fn abort_conflict(
        &self,
        operation_id: OperationId,
        root_id: WorkspaceRootId,
        root: &MultiRootMergeRoot,
        projected_generation: GenerationId,
    ) -> impl Future<Output = Result<GenerationId, Self::Error>> + StorageFuture;
    fn declare_conflicts(
        &self,
        operation_id: OperationId,
        root_id: WorkspaceRootId,
        root: &MultiRootMergeRoot,
        conflict: &MergePlan,
        paths: &[String],
    ) -> impl Future<Output = Result<BTreeSet<ConflictKey>, Self::Error>> + StorageFuture;
    fn finish_conflict(
        &self,
        operation_id: OperationId,
        root_id: WorkspaceRootId,
        root: &MultiRootMergeRoot,
        projected_generation: GenerationId,
    ) -> impl Future<Output = Result<MultiRootConflictFinish, Self::Error>> + StorageFuture;
    fn publish(
        &self,
        operation_id: OperationId,
        root_id: WorkspaceRootId,
        root: &MultiRootMergeRoot,
        resolutions: &BTreeMap<ConflictKey, MergeResolution>,
        fence: &MultiRootFence,
    ) -> impl Future<Output = Result<MultiRootPublishRoot, Self::Error>> + StorageFuture;

    // Provided method
    fn finalize(
        &self,
        _operation_id: OperationId,
        _root_id: WorkspaceRootId,
        _root: &MultiRootMergeRoot,
    ) -> impl Future<Output = Result<(), Self::Error>> + StorageFuture { ... }
}
Expand description

Root-specific publisher backed by the ordinary join and materializer APIs.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Publisher error.

Required Methods§

Source

fn prepare( &self, operation_id: OperationId, root_id: WorkspaceRootId, root: &MultiRootMergeRoot, resolutions: &BTreeMap<ConflictKey, MergeResolution>, ) -> impl Future<Output = Result<MultiRootPrepare, Self::Error>> + StorageFuture

Atomically validates and reserves the exact pinned target. Repeating this call for one operation must return the same live reservation.

Source

fn release( &self, operation_id: OperationId, root_id: WorkspaceRootId, fence: &MultiRootFence, ) -> impl Future<Output = Result<(), Self::Error>> + StorageFuture

Releases a reservation when validation fails before a commit decision.

Source

fn project_conflict( &self, operation_id: OperationId, root_id: WorkspaceRootId, root: &MultiRootMergeRoot, conflict: Option<&MergePlan>, ) -> impl Future<Output = Result<GenerationId, Self::Error>> + StorageFuture

Projects one root into its durable conflicted working state.

Source

fn abort_conflict( &self, operation_id: OperationId, root_id: WorkspaceRootId, root: &MultiRootMergeRoot, projected_generation: GenerationId, ) -> impl Future<Output = Result<GenerationId, Self::Error>> + StorageFuture

Restores one projected root to its exact pre-merge generation.

Source

fn declare_conflicts( &self, operation_id: OperationId, root_id: WorkspaceRootId, root: &MultiRootMergeRoot, conflict: &MergePlan, paths: &[String], ) -> impl Future<Output = Result<BTreeSet<ConflictKey>, Self::Error>> + StorageFuture

Validates explicitly staged conflict paths and returns their exact keys.

Source

fn finish_conflict( &self, operation_id: OperationId, root_id: WorkspaceRootId, root: &MultiRootMergeRoot, projected_generation: GenerationId, ) -> impl Future<Output = Result<MultiRootConflictFinish, Self::Error>> + StorageFuture

Captures the current resolved working generation during continue.

Source

fn publish( &self, operation_id: OperationId, root_id: WorkspaceRootId, root: &MultiRootMergeRoot, resolutions: &BTreeMap<ConflictKey, MergeResolution>, fence: &MultiRootFence, ) -> impl Future<Output = Result<MultiRootPublishRoot, Self::Error>> + StorageFuture

Idempotently rolls one root forward after the durable commit decision.

Provided Methods§

Source

fn finalize( &self, _operation_id: OperationId, _root_id: WorkspaceRootId, _root: &MultiRootMergeRoot, ) -> impl Future<Output = Result<(), Self::Error>> + StorageFuture

Reclaims terminal per-root recovery state after the all-roots Applied decision is durable. It must be idempotent because restart recovery retries cleanup independently of logical publication.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§