pub enum AnyBackend {
GitWorktree(GitWorktreeBackend),
Reflink(RefLinkBackend),
Overlay(OverlayBackend),
Copy(CopyBackend),
}Expand description
A concrete backend selected at runtime based on platform capabilities and configuration. Dispatches to the appropriate implementation.
Using an enum (rather than Box<dyn WorkspaceBackend>) avoids dynamic
dispatch and keeps the Error associated type monomorphic.
Variants§
GitWorktree(GitWorktreeBackend)
Git worktree backend — always available.
Reflink(RefLinkBackend)
Reflink (CoW) backend — requires a CoW-capable filesystem.
Overlay(OverlayBackend)
OverlayFS backend — Linux only.
Copy(CopyBackend)
Plain recursive-copy backend — universal fallback.
Implementations§
Source§impl AnyBackend
impl AnyBackend
Sourcepub fn from_kind(kind: BackendKind, root: PathBuf) -> Result<Self>
pub fn from_kind(kind: BackendKind, root: PathBuf) -> Result<Self>
Construct the appropriate backend for the resolved (non-Auto) kind and repo root.
If kind is BackendKind::Auto (which should be resolved before calling
this function), falls back to GitWorktree.
§Errors
Returns an error if the overlay backend is selected but is not supported on this platform (not Linux, or no mount strategy available).