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§
Required Methods§
Sourcefn prepare(
&self,
operation_id: OperationId,
root_id: WorkspaceRootId,
root: &MultiRootMergeRoot,
resolutions: &BTreeMap<ConflictKey, MergeResolution>,
) -> impl Future<Output = Result<MultiRootPrepare, Self::Error>> + StorageFuture
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.
Sourcefn release(
&self,
operation_id: OperationId,
root_id: WorkspaceRootId,
fence: &MultiRootFence,
) -> impl Future<Output = Result<(), Self::Error>> + StorageFuture
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.
Sourcefn project_conflict(
&self,
operation_id: OperationId,
root_id: WorkspaceRootId,
root: &MultiRootMergeRoot,
conflict: Option<&MergePlan>,
) -> impl Future<Output = Result<GenerationId, 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
Projects one root into its durable conflicted working state.
Sourcefn abort_conflict(
&self,
operation_id: OperationId,
root_id: WorkspaceRootId,
root: &MultiRootMergeRoot,
projected_generation: GenerationId,
) -> 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
Restores one projected root to its exact pre-merge generation.
Sourcefn 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 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.
Sourcefn finish_conflict(
&self,
operation_id: OperationId,
root_id: WorkspaceRootId,
root: &MultiRootMergeRoot,
projected_generation: GenerationId,
) -> impl Future<Output = Result<MultiRootConflictFinish, 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
Captures the current resolved working generation during continue.
Sourcefn publish(
&self,
operation_id: OperationId,
root_id: WorkspaceRootId,
root: &MultiRootMergeRoot,
resolutions: &BTreeMap<ConflictKey, MergeResolution>,
fence: &MultiRootFence,
) -> impl Future<Output = Result<MultiRootPublishRoot, 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
Idempotently rolls one root forward after the durable commit decision.
Provided Methods§
Sourcefn finalize(
&self,
_operation_id: OperationId,
_root_id: WorkspaceRootId,
_root: &MultiRootMergeRoot,
) -> impl Future<Output = Result<(), Self::Error>> + StorageFuture
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".