Skip to main content

WorkspaceProvider

Trait WorkspaceProvider 

Source
pub trait WorkspaceProvider: Send + Sync {
    // Required methods
    fn id(&self) -> WorkspaceProviderId;
    fn open_workspace<'life0, 'life1, 'async_trait>(
        &'life0 self,
        locator: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<WorkspaceDescriptor, WorkspaceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn open_workspace_from_binding<'life0, 'life1, 'async_trait>(
        &'life0 self,
        binding: &'life1 WorkspaceBinding,
    ) -> Pin<Box<dyn Future<Output = Result<WorkspaceDescriptor, WorkspaceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_head<'life0, 'life1, 'async_trait>(
        &'life0 self,
        workspace: &'life1 WorkspaceDescriptor,
        request: WorkspaceHeadRequest,
    ) -> Pin<Box<dyn Future<Output = Result<WorkspaceHeadResource, WorkspaceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn reopen_head<'life0, 'life1, 'async_trait>(
        &'life0 self,
        binding: &'life1 WorkspaceBinding,
    ) -> Pin<Box<dyn Future<Output = Result<WorkspaceHeadResource, WorkspaceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn checkpoint<'life0, 'life1, 'async_trait>(
        &'life0 self,
        binding: &'life1 WorkspaceBinding,
    ) -> Pin<Box<dyn Future<Output = Result<WorkspaceCheckpoint, WorkspaceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn status<'life0, 'life1, 'async_trait>(
        &'life0 self,
        binding: &'life1 WorkspaceBinding,
    ) -> Pin<Box<dyn Future<Output = Result<WorkspaceHeadStatus, WorkspaceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn diff<'life0, 'life1, 'async_trait>(
        &'life0 self,
        binding: &'life1 WorkspaceBinding,
    ) -> Pin<Box<dyn Future<Output = Result<WorkspaceDiff, WorkspaceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn archive<'life0, 'life1, 'async_trait>(
        &'life0 self,
        binding: &'life1 WorkspaceBinding,
    ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn destroy<'life0, 'life1, 'async_trait>(
        &'life0 self,
        binding: &'life1 WorkspaceBinding,
    ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Open service-provider interface for physical workspace implementations.

Git worktrees are one implementation. Remote filesystems, containers, and object-backed snapshots can implement the same trait without registering a backend enum or exposing physical paths in the universal contract.

Required Methods§

Source

fn id(&self) -> WorkspaceProviderId

Source

fn open_workspace<'life0, 'life1, 'async_trait>( &'life0 self, locator: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceDescriptor, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn open_workspace_from_binding<'life0, 'life1, 'async_trait>( &'life0 self, binding: &'life1 WorkspaceBinding, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceDescriptor, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reopen a logical workspace using only its recorded opaque binding.

Source

fn create_head<'life0, 'life1, 'async_trait>( &'life0 self, workspace: &'life1 WorkspaceDescriptor, request: WorkspaceHeadRequest, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceHeadResource, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn reopen_head<'life0, 'life1, 'async_trait>( &'life0 self, binding: &'life1 WorkspaceBinding, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceHeadResource, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, binding: &'life1 WorkspaceBinding, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceCheckpoint, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn status<'life0, 'life1, 'async_trait>( &'life0 self, binding: &'life1 WorkspaceBinding, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceHeadStatus, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn diff<'life0, 'life1, 'async_trait>( &'life0 self, binding: &'life1 WorkspaceBinding, ) -> Pin<Box<dyn Future<Output = Result<WorkspaceDiff, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn archive<'life0, 'life1, 'async_trait>( &'life0 self, binding: &'life1 WorkspaceBinding, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Archive a head while retaining its provider-owned contents.

Source

fn destroy<'life0, 'life1, 'async_trait>( &'life0 self, binding: &'life1 WorkspaceBinding, ) -> Pin<Box<dyn Future<Output = Result<(), WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Explicitly destroy provider-owned head storage.

Providers must never call this from Drop. Provider-specific durable lineage such as a Git branch is retained unless the provider documents a separate, explicit deletion operation.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§