pub struct Workspace {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}Fields§
§proc: Option<Arc<DaggerSessionProc>>§selection: Selection§graphql_client: DynGraphQLClientImplementations§
Source§impl Workspace
impl Workspace
Sourcepub async fn address(&self) -> Result<String, DaggerError>
pub async fn address(&self) -> Result<String, DaggerError>
Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.
Sourcepub fn agents(&self) -> AgentMiddlewareGroup
pub fn agents(&self) -> AgentMiddlewareGroup
Return all agent middlewares from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn agents_opts<'a>(
&self,
opts: WorkspaceAgentsOpts<'a>,
) -> AgentMiddlewareGroup
pub fn agents_opts<'a>( &self, opts: WorkspaceAgentsOpts<'a>, ) -> AgentMiddlewareGroup
Return all agent middlewares from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn changes(&self) -> Changeset
pub fn changes(&self) -> Changeset
Return this workspace’s changes, with paths relative to its working directory. Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset
pub fn changes_opts(&self, opts: WorkspaceChangesOpts) -> Changeset
Return this workspace’s changes, with paths relative to its working directory. Pass from to compare against an earlier workspace state. Omitting it preserves the cumulative behavior used by clients from before this argument was added.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn checks(&self) -> CheckGroup
pub fn checks(&self) -> CheckGroup
Return all checks from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup
pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup
Return all checks from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn compare_commits_from(
&self,
source: impl IntoID<Id>,
) -> Result<Vec<WorkspaceCommitPick>, DaggerError>
pub async fn compare_commits_from( &self, source: impl IntoID<Id>, ) -> Result<Vec<WorkspaceCommitPick>, DaggerError>
Preview which source commits withCommitsFrom would apply, skip, or report as conflicting. Results are ordered oldest first and account for earlier applicable commits in the same preview. The preview does not apply commits or write to the checkout. A local receiver is snapshotted automatically; untracked files require interactive approval. Source uncommitted changes are ignored. Exceeding maxCommits fails rather than returning a partial preview. Divergent merge commits require manual integration.
§Arguments
source- Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn compare_commits_from_opts<'a>(
&self,
source: impl IntoID<Id>,
opts: WorkspaceCompareCommitsFromOpts<'a>,
) -> Result<Vec<WorkspaceCommitPick>, DaggerError>
pub async fn compare_commits_from_opts<'a>( &self, source: impl IntoID<Id>, opts: WorkspaceCompareCommitsFromOpts<'a>, ) -> Result<Vec<WorkspaceCommitPick>, DaggerError>
Preview which source commits withCommitsFrom would apply, skip, or report as conflicting. Results are ordered oldest first and account for earlier applicable commits in the same preview. The preview does not apply commits or write to the checkout. A local receiver is snapshotted automatically; untracked files require interactive approval. Source uncommitted changes are ignored. Exceeding maxCommits fails rather than returning a partial preview. Divergent merge commits require manual integration.
§Arguments
source- Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn config_file(&self) -> Result<String, DaggerError>
pub async fn config_file(&self) -> Result<String, DaggerError>
Selected native workspace config file relative to the workspace cwd, if any.
Sourcepub async fn config_read(&self) -> Result<String, DaggerError>
pub async fn config_read(&self) -> Result<String, DaggerError>
Read a configuration value from dagger.toml. If key is empty, returns the full config. If key points to a scalar, returns the value. If key points to a table, returns flattened dotted-key output.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn config_read_opts<'a>(
&self,
opts: WorkspaceConfigReadOpts<'a>,
) -> Result<String, DaggerError>
pub async fn config_read_opts<'a>( &self, opts: WorkspaceConfigReadOpts<'a>, ) -> Result<String, DaggerError>
Read a configuration value from dagger.toml. If key is empty, returns the full config. If key points to a scalar, returns the value. If key points to a table, returns flattened dotted-key output.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn cwd(&self) -> Result<String, DaggerError>
pub async fn cwd(&self) -> Result<String, DaggerError>
Current location within the workspace root. The workspace root is returned as “/”. Relative paths in workspace APIs resolve from here.
Sourcepub async fn detect_scope(
&self,
sdk: impl Into<String>,
) -> Result<String, DaggerError>
pub async fn detect_scope( &self, sdk: impl Into<String>, ) -> Result<String, DaggerError>
Return the selected SDK module’s current scope at this workspace location.
§Arguments
sdk- SDK name to probe. Required.
Sourcepub fn directory(&self, path: impl Into<String>) -> Directory
pub fn directory(&self, path: impl Into<String>) -> Directory
Returns a Directory from the workspace. Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
§Arguments
path- Location of the directory to retrieve. Relative paths (e.g., “src”) resolve from the workspace cwd; absolute paths (e.g., “/src”) resolve from the workspace root.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn directory_opts<'a>(
&self,
path: impl Into<String>,
opts: WorkspaceDirectoryOpts<'a>,
) -> Directory
pub fn directory_opts<'a>( &self, path: impl Into<String>, opts: WorkspaceDirectoryOpts<'a>, ) -> Directory
Returns a Directory from the workspace. Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
§Arguments
path- Location of the directory to retrieve. Relative paths (e.g., “src”) resolve from the workspace cwd; absolute paths (e.g., “/src”) resolve from the workspace root.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn entrypoint(&self) -> Result<String, DaggerError>
pub async fn entrypoint(&self) -> Result<String, DaggerError>
Installed name of the module selected as the workspace entrypoint, or an empty string when none is selected. Reflects the selected env’s effective view. Fails if several modules are selected.
Sourcepub async fn env_list(&self) -> Result<Vec<String>, DaggerError>
pub async fn env_list(&self) -> Result<Vec<String>, DaggerError>
List named environments defined in the workspace configuration.
Sourcepub async fn export(&self) -> Result<Void, DaggerError>
pub async fn export(&self) -> Result<Void, DaggerError>
Write this workspace’s commits and pending changes to a checkout on the calling client. With path, accept a frozen source, integrate divergent commits by cherry-picking, preserve unrelated checkout edits, and refuse conflicts. The source is unchanged. Pass from to save only work since an earlier source value, including previously saved pending edits that are now committed. Without path, apply a local workspace’s overlay changes at its host root. Pass from to apply only changes since an earlier local workspace state. Export paths are relative to the workspace root regardless of its working directory. Like Directory.export, this writes only to the client making the call, never the source’s client.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn export_opts<'a>(
&self,
opts: WorkspaceExportOpts<'a>,
) -> Result<Void, DaggerError>
pub async fn export_opts<'a>( &self, opts: WorkspaceExportOpts<'a>, ) -> Result<Void, DaggerError>
Write this workspace’s commits and pending changes to a checkout on the calling client. With path, accept a frozen source, integrate divergent commits by cherry-picking, preserve unrelated checkout edits, and refuse conflicts. The source is unchanged. Pass from to save only work since an earlier source value, including previously saved pending edits that are now committed. Without path, apply a local workspace’s overlay changes at its host root. Pass from to apply only changes since an earlier local workspace state. Export paths are relative to the workspace root regardless of its working directory. Like Directory.export, this writes only to the client making the call, never the source’s client.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn file(&self, path: impl Into<String>) -> File
pub fn file(&self, path: impl Into<String>) -> File
Returns a File from the workspace. Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
§Arguments
path- Location of the file to retrieve. Relative paths (e.g., “go.mod”) resolve from the workspace cwd; absolute paths (e.g., “/go.mod”) resolve from the workspace root.
Sourcepub async fn find_roots(
&self,
markers: Vec<impl Into<String>>,
) -> Result<Vec<String>, DaggerError>
pub async fn find_roots( &self, markers: Vec<impl Into<String>>, ) -> Result<Vec<String>, DaggerError>
Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd. Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked. Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
§Arguments
markers- File basenames that mark a project root (e.g. [“go.mod”] or [“deno.json”, “deno.jsonc”]).opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn find_roots_opts<'a>(
&self,
markers: Vec<impl Into<String>>,
opts: WorkspaceFindRootsOpts<'a>,
) -> Result<Vec<String>, DaggerError>
pub async fn find_roots_opts<'a>( &self, markers: Vec<impl Into<String>>, opts: WorkspaceFindRootsOpts<'a>, ) -> Result<Vec<String>, DaggerError>
Find project roots marked by any of the given filenames, starting from a path relative to the workspace cwd. Returns cwd-relative directory paths for every marked directory at or below start, plus the nearest marked ancestor when start itself is not marked. Each returned path is usable as-is with other workspace APIs, e.g. directory(path).
§Arguments
markers- File basenames that mark a project root (e.g. [“go.mod”] or [“deno.json”, “deno.jsonc”]).opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn find_up(
&self,
name: impl Into<String>,
) -> Result<String, DaggerError>
pub async fn find_up( &self, name: impl Into<String>, ) -> Result<String, DaggerError>
Search for a file or directory by walking up from the start path within the workspace. Returns the absolute workspace path if found, or null if not found. Relative start paths resolve from the workspace cwd. The search stops at the workspace root and will not traverse above it.
§Arguments
name- The name of the file or directory to search for.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn find_up_opts<'a>(
&self,
name: impl Into<String>,
opts: WorkspaceFindUpOpts<'a>,
) -> Result<String, DaggerError>
pub async fn find_up_opts<'a>( &self, name: impl Into<String>, opts: WorkspaceFindUpOpts<'a>, ) -> Result<String, DaggerError>
Search for a file or directory by walking up from the start path within the workspace. Returns the absolute workspace path if found, or null if not found. Relative start paths resolve from the workspace cwd. The search stops at the workspace root and will not traverse above it.
§Arguments
name- The name of the file or directory to search for.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn generators(&self) -> GeneratorGroup
pub fn generators(&self) -> GeneratorGroup
Return all generators from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn generators_opts<'a>(
&self,
opts: WorkspaceGeneratorsOpts<'a>,
) -> GeneratorGroup
pub fn generators_opts<'a>( &self, opts: WorkspaceGeneratorsOpts<'a>, ) -> GeneratorGroup
Return all generators from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn git(&self) -> WorkspaceGit
pub fn git(&self) -> WorkspaceGit
Git state for this workspace. Errors if the workspace is not in a git repository.
Sourcepub async fn glob(
&self,
pattern: impl Into<String>,
) -> Result<Vec<String>, DaggerError>
pub async fn glob( &self, pattern: impl Into<String>, ) -> Result<Vec<String>, DaggerError>
Returns a list of files and directories that match the given pattern. Patterns match paths relative to the workspace root.
§Arguments
pattern- Pattern to match (e.g., “*.md”).
Sourcepub async fn id(&self) -> Result<Id, DaggerError>
pub async fn id(&self) -> Result<Id, DaggerError>
A unique identifier for this Workspace.
Sourcepub fn migrate(&self) -> WorkspaceMigration
pub fn migrate(&self) -> WorkspaceMigration
Plan the explicit migration needed for the current workspace. Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected. The returned plan has an empty changeset and no steps when no migration is needed.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn migrate_opts<'a>(
&self,
opts: WorkspaceMigrateOpts<'a>,
) -> WorkspaceMigration
pub fn migrate_opts<'a>( &self, opts: WorkspaceMigrateOpts<'a>, ) -> WorkspaceMigration
Plan the explicit migration needed for the current workspace. Include installed local modules and their local dependencies. Other module candidates remain unchanged unless selected. The returned plan has an empty changeset and no steps when no migration is needed.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn migrate_module(&self) -> WorkspaceMigration
pub fn migrate_module(&self) -> WorkspaceMigration
Plan migration of one local module without migrating its dependencies or creating a workspace configuration. Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn migrate_module_opts<'a>(
&self,
opts: WorkspaceMigrateModuleOpts<'a>,
) -> WorkspaceMigration
pub fn migrate_module_opts<'a>( &self, opts: WorkspaceMigrateModuleOpts<'a>, ) -> WorkspaceMigration
Plan migration of one local module without migrating its dependencies or creating a workspace configuration. Include SDK registration when a workspace configuration exists and remove obsolete generated-file ignore rules.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn module(&self, name: impl Into<String>) -> WorkspaceModule
pub fn module(&self, name: impl Into<String>) -> WorkspaceModule
Return a module defined in the workspace configuration. Reflects the selected env’s effective view.
§Arguments
name- Module name to inspect.
Sourcepub fn module_source(&self, path: impl Into<String>) -> ModuleSource
pub fn module_source(&self, path: impl Into<String>) -> ModuleSource
Load a module source from a path within the workspace. Relative paths (e.g., “foo”) resolve from the workspace cwd; absolute paths (e.g., “/foo”) resolve from the workspace root. Fails if the path does not point to an initialized module.
§Arguments
path- Location of the module source to load, relative to the workspace cwd or absolute from the workspace root.
Sourcepub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError>
pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError>
List modules defined in the workspace configuration. Reflects the selected env’s effective view.
Sourcepub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk
pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk
Sourcepub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError>
pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError>
Installed SDKs.
Sourcepub async fn search(
&self,
pattern: impl Into<String>,
) -> Result<Vec<SearchResult>, DaggerError>
pub async fn search( &self, pattern: impl Into<String>, ) -> Result<Vec<SearchResult>, DaggerError>
Searches for content matching the given regular expression or literal string. Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes. Runs ripgrep on the client host, falling back to grep if unavailable.
§Arguments
pattern- The text to match.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn search_opts<'a>(
&self,
pattern: impl Into<String>,
opts: WorkspaceSearchOpts<'a>,
) -> Result<Vec<SearchResult>, DaggerError>
pub async fn search_opts<'a>( &self, pattern: impl Into<String>, opts: WorkspaceSearchOpts<'a>, ) -> Result<Vec<SearchResult>, DaggerError>
Searches for content matching the given regular expression or literal string. Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes. Runs ripgrep on the client host, falling back to grep if unavailable.
§Arguments
pattern- The text to match.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn services(&self) -> UpGroup
pub fn services(&self) -> UpGroup
Return all services from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup
pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup
Return all services from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn snapshot(&self) -> Workspace
pub fn snapshot(&self) -> Workspace
Return a snapshot of this workspace as a stable value. Git capture is a progressive enhancement: if the workspace has no Git repository or commits, or the client cannot capture Git, return this workspace unchanged. Approval rejections and capture failures remain errors. Use the returned workspace for subsequent reads, edits, and module loading against the captured baseline. Snapshotting an existing stable value preserves its baseline; snapshot currentWorkspace again to capture later checkout changes. Only the owning client can capture a local checkout. Tracked changes are captured automatically; untracked files require interactive approval. Remote Git refs are pinned to their resolved commits. Capturing leaves the checkout unchanged. The recipe is portable when a remote can serve its base; otherwise it is frozen for this session only.
Sourcepub fn terminals(&self) -> TerminalGroup
pub fn terminals(&self) -> TerminalGroup
Return all terminal targets from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn terminals_opts<'a>(
&self,
opts: WorkspaceTerminalsOpts<'a>,
) -> TerminalGroup
pub fn terminals_opts<'a>( &self, opts: WorkspaceTerminalsOpts<'a>, ) -> TerminalGroup
Return all terminal targets from modules loaded in the workspace.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace
pub fn with_changes(&self, changes: impl IntoID<Id>) -> Workspace
Return this workspace with a changeset applied, without mutating the source.
§Arguments
changes- Changes to apply.
Sourcepub fn with_client(&self, module: impl Into<String>) -> Workspace
pub fn with_client(&self, module: impl Into<String>) -> Workspace
Return this workspace with a generated module client added to one SDK scope. Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
§Arguments
module- Explicit local path or module address to generate a client for. Installed module names are not supported.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_client_opts<'a>(
&self,
module: impl Into<String>,
opts: WorkspaceWithClientOpts<'a>,
) -> Workspace
pub fn with_client_opts<'a>( &self, module: impl Into<String>, opts: WorkspaceWithClientOpts<'a>, ) -> Workspace
Return this workspace with a generated module client added to one SDK scope. Select the deepest detected or registered scope. Fail if several SDKs have that deepest scope.
§Arguments
module- Explicit local path or module address to generate a client for. Installed module names are not supported.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_commit(
&self,
changes: impl IntoID<Id>,
message: impl Into<String>,
date: impl Into<String>,
) -> Workspace
pub fn with_commit( &self, changes: impl IntoID<Id>, message: impl Into<String>, date: impl Into<String>, ) -> Workspace
Create a Git commit from a changeset and return a stable workspace with HEAD advanced. The changeset is three-way merged into both HEAD and the frozen working tree. Compatible unselected edits remain uncommitted; incoming changes need not already be in the working tree. Conflicts with either tree fail without modifying the workspace. Empty changesets, or changes already present in HEAD, fail with nothing to commit. A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified. Missing author fields are resolved from Git config in the calling client’s working directory at commit time, then recorded explicitly for reproducible commits. Unconfigured fields default to Dagger and dagger@localhost.
§Arguments
changes- Changeset to commit, for example git.uncommitted.filter(…). Paths are rooted at the repository; rename sides are determined by the changeset. Git metadata (.git) is ignored; metadata-only changes fail with nothing to commit.message- Commit message.date- RFC3339 author and committer date. Required for reproducible commits.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_commit_opts<'a>(
&self,
changes: impl IntoID<Id>,
message: impl Into<String>,
date: impl Into<String>,
opts: WorkspaceWithCommitOpts<'a>,
) -> Workspace
pub fn with_commit_opts<'a>( &self, changes: impl IntoID<Id>, message: impl Into<String>, date: impl Into<String>, opts: WorkspaceWithCommitOpts<'a>, ) -> Workspace
Create a Git commit from a changeset and return a stable workspace with HEAD advanced. The changeset is three-way merged into both HEAD and the frozen working tree. Compatible unselected edits remain uncommitted; incoming changes need not already be in the working tree. Conflicts with either tree fail without modifying the workspace. Empty changesets, or changes already present in HEAD, fail with nothing to commit. A local workspace is snapshotted automatically before committing; untracked files require interactive approval. The host checkout is not modified. Missing author fields are resolved from Git config in the calling client’s working directory at commit time, then recorded explicitly for reproducible commits. Unconfigured fields default to Dagger and dagger@localhost.
§Arguments
changes- Changeset to commit, for example git.uncommitted.filter(…). Paths are rooted at the repository; rename sides are determined by the changeset. Git metadata (.git) is ignored; metadata-only changes fail with nothing to commit.message- Commit message.date- RFC3339 author and committer date. Required for reproducible commits.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace
pub fn with_commits_from(&self, source: impl IntoID<Id>) -> Workspace
Integrate source commits into this workspace and return the result, preserving this workspace’s uncommitted changes and metadata. Fast-forward when the selected commits include all new ancestors of their tip; otherwise cherry-pick them oldest first. Already integrated commits and patches already present are skipped. Any conflict fails the operation. Source uncommitted changes are not transferred; merge them explicitly if needed. Use compareCommitsFrom to preview the integration. A local receiver is snapshotted automatically; untracked files require interactive approval. The checkout is not modified. Export the result with an explicit path to write it to a checkout. Cherry-picks preserve the source author and author date, use the calling client’s Git config for committer identity, and reuse the source committer date for reproducible hashes. Origin trailers track cherry-picked commits. Divergent merge commits require manual integration.
§Arguments
source- Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_commits_from_opts<'a>(
&self,
source: impl IntoID<Id>,
opts: WorkspaceWithCommitsFromOpts<'a>,
) -> Workspace
pub fn with_commits_from_opts<'a>( &self, source: impl IntoID<Id>, opts: WorkspaceWithCommitsFromOpts<'a>, ) -> Workspace
Integrate source commits into this workspace and return the result, preserving this workspace’s uncommitted changes and metadata. Fast-forward when the selected commits include all new ancestors of their tip; otherwise cherry-pick them oldest first. Already integrated commits and patches already present are skipped. Any conflict fails the operation. Source uncommitted changes are not transferred; merge them explicitly if needed. Use compareCommitsFrom to preview the integration. A local receiver is snapshotted automatically; untracked files require interactive approval. The checkout is not modified. Export the result with an explicit path to write it to a checkout. Cherry-picks preserve the source author and author date, use the calling client’s Git config for committer identity, and reuse the source committer date for reproducible hashes. Origin trailers track cherry-picked commits. Divergent merge commits require manual integration.
§Arguments
source- Git-backed source workspace. For a local checkout, call snapshot on the source first and pass the returned workspace.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_config_env(&self, name: impl Into<String>) -> Workspace
pub fn with_config_env(&self, name: impl Into<String>) -> Workspace
Return this workspace with a named config environment created.
§Arguments
name- Environment name.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_config_env_opts(
&self,
name: impl Into<String>,
opts: WorkspaceWithConfigEnvOpts,
) -> Workspace
pub fn with_config_env_opts( &self, name: impl Into<String>, opts: WorkspaceWithConfigEnvOpts, ) -> Workspace
Return this workspace with a named config environment created.
§Arguments
name- Environment name.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_config_environment(&self, name: impl Into<String>) -> Workspace
pub fn with_config_environment(&self, name: impl Into<String>) -> Workspace
Select the config environment carried by this workspace.
§Arguments
name- Environment name, or empty to clear the selection.
Sourcepub fn with_config_paths(
&self,
config_file: impl Into<String>,
lock_file: impl Into<String>,
) -> Workspace
pub fn with_config_paths( &self, config_file: impl Into<String>, lock_file: impl Into<String>, ) -> Workspace
Select workspace-root-relative config and lockfile paths. Empty paths clear the selection.
§Arguments
config_file- Config file path.lock_file- Lockfile path.
Sourcepub fn with_config_value(
&self,
key: impl Into<String>,
value: impl Into<String>,
) -> Workspace
pub fn with_config_value( &self, key: impl Into<String>, value: impl Into<String>, ) -> Workspace
Return this workspace with a configuration value written. When the session selects an env, the key is scoped to that env’s overlay and the env is created if missing.
§Arguments
key- Dotted key path.value- Value to set. Bools, integers, and comma-separated arrays are auto-detected.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_config_value_opts<'a>(
&self,
key: impl Into<String>,
value: impl Into<String>,
opts: WorkspaceWithConfigValueOpts<'a>,
) -> Workspace
pub fn with_config_value_opts<'a>( &self, key: impl Into<String>, value: impl Into<String>, opts: WorkspaceWithConfigValueOpts<'a>, ) -> Workspace
Return this workspace with a configuration value written. When the session selects an env, the key is scoped to that env’s overlay and the env is created if missing.
§Arguments
key- Dotted key path.value- Value to set. Bools, integers, and comma-separated arrays are auto-detected.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_directory(
&self,
path: impl Into<String>,
source: impl IntoID<Id>,
) -> Workspace
pub fn with_directory( &self, path: impl Into<String>, source: impl IntoID<Id>, ) -> Workspace
Return this workspace with a directory merged into the given path, without mutating the source. Anything already at the path stays, and files the source carries win, as with Directory.withDirectory. Use withNewDirectory to replace the path instead.
§Arguments
path- Path to merge into. Relative paths resolve from the workspace cwd.source- Directory to merge there.
Sourcepub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace
pub fn with_entrypoint(&self, name: impl Into<String>) -> Workspace
Return this workspace with an installed module selected as its entrypoint. Every other entrypoint selection is cleared. Entrypoints live in the base workspace config.
§Arguments
name- Exact installed module name.
Sourcepub fn with_file(
&self,
path: impl Into<String>,
source: impl IntoID<Id>,
) -> Workspace
pub fn with_file( &self, path: impl Into<String>, source: impl IntoID<Id>, ) -> Workspace
Return this workspace with a file added or replaced, without mutating the source.
§Arguments
path- Destination path. Relative paths resolve from the workspace cwd.source- File to add.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_file_opts(
&self,
path: impl Into<String>,
source: impl IntoID<Id>,
opts: WorkspaceWithFileOpts,
) -> Workspace
pub fn with_file_opts( &self, path: impl Into<String>, source: impl IntoID<Id>, opts: WorkspaceWithFileOpts, ) -> Workspace
Return this workspace with a file added or replaced, without mutating the source.
§Arguments
path- Destination path. Relative paths resolve from the workspace cwd.source- File to add.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace
pub fn with_init_module(&self, sdk: impl Into<String>) -> Workspace
Return this workspace with a location initialized as a module scope. The selected SDK module records the scope and generates the module source.
§Arguments
sdk- Workspace SDK name or module entry name to use. Required.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_init_module_opts<'a>(
&self,
sdk: impl Into<String>,
opts: WorkspaceWithInitModuleOpts<'a>,
) -> Workspace
pub fn with_init_module_opts<'a>( &self, sdk: impl Into<String>, opts: WorkspaceWithInitModuleOpts<'a>, ) -> Workspace
Return this workspace with a location initialized as a module scope. The selected SDK module records the scope and generates the module source.
§Arguments
sdk- Workspace SDK name or module entry name to use. Required.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_initialized(&self) -> Workspace
pub fn with_initialized(&self) -> Workspace
Return this workspace with a native configuration, without changing an existing configuration. Fail if legacy configuration needs workspace migration.
Sourcepub fn with_module(&self, ref: impl Into<String>) -> Workspace
pub fn with_module(&self, ref: impl Into<String>) -> Workspace
Return this workspace with a module installed in its config. When the session selects an env, the module is recorded in that env’s overlay and the env is created if missing.
§Arguments
r#ref- Module reference to install.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_module_opts<'a>(
&self,
ref: impl Into<String>,
opts: WorkspaceWithModuleOpts<'a>,
) -> Workspace
pub fn with_module_opts<'a>( &self, ref: impl Into<String>, opts: WorkspaceWithModuleOpts<'a>, ) -> Workspace
Return this workspace with a module installed in its config. When the session selects an env, the module is recorded in that env’s overlay and the env is created if missing.
§Arguments
r#ref- Module reference to install.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_mounted_directory(
&self,
path: impl Into<String>,
source: impl IntoID<Id>,
) -> Workspace
pub fn with_mounted_directory( &self, path: impl Into<String>, source: impl IntoID<Id>, ) -> Workspace
Return this workspace with a directory mounted read-only at the given path, without mutating the source. Mounted content is readable through the normal workspace file tools but shadows the source at the mount path and stays out of the pending changeset: it never appears in changes, is never exported, and cannot be modified.
§Arguments
path- Location of the mounted directory. Relative paths resolve from the workspace cwd.source- Directory to mount.
Sourcepub fn with_mounted_file(
&self,
path: impl Into<String>,
source: impl IntoID<Id>,
) -> Workspace
pub fn with_mounted_file( &self, path: impl Into<String>, source: impl IntoID<Id>, ) -> Workspace
Return this workspace with a file mounted read-only at the given path, without mutating the source. Mounted content is readable through the normal workspace file tools but shadows the source at the mount path and stays out of the pending changeset: it never appears in changes, is never exported, and cannot be modified.
§Arguments
path- Location of the mounted file. Relative paths resolve from the workspace cwd.source- File to mount.
Sourcepub fn with_new_directory(
&self,
path: impl Into<String>,
source: impl IntoID<Id>,
) -> Workspace
pub fn with_new_directory( &self, path: impl Into<String>, source: impl IntoID<Id>, ) -> Workspace
Return this workspace with the given path replaced by a directory, without mutating the source. The source becomes the entire contents of the path: anything already there that the source does not carry is removed. Use withDirectory to keep it instead.
§Arguments
path- Path to replace. Relative paths resolve from the workspace cwd.source- Directory to write there.
Sourcepub fn with_new_file(
&self,
path: impl Into<String>,
contents: impl Into<String>,
) -> Workspace
pub fn with_new_file( &self, path: impl Into<String>, contents: impl Into<String>, ) -> Workspace
Return this workspace with a new or replaced file, without mutating the source.
§Arguments
path- Path of the new file. Relative paths resolve from the workspace cwd.contents- Contents of the new file.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_new_file_opts(
&self,
path: impl Into<String>,
contents: impl Into<String>,
opts: WorkspaceWithNewFileOpts,
) -> Workspace
pub fn with_new_file_opts( &self, path: impl Into<String>, contents: impl Into<String>, opts: WorkspaceWithNewFileOpts, ) -> Workspace
Return this workspace with a new or replaced file, without mutating the source.
§Arguments
path- Path of the new file. Relative paths resolve from the workspace cwd.contents- Contents of the new file.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_reset(&self, commit: impl Into<String>) -> Workspace
pub fn with_reset(&self, commit: impl Into<String>) -> Workspace
Move this workspace’s Git HEAD to a commit and return the resulting stable workspace. A local workspace is snapshotted automatically before resetting; untracked files require interactive approval. The host checkout is not modified. By default the difference between the previous working tree and the target commit stays uncommitted, as with git reset –mixed, so history can be reworked and reapplied with withCommit — e.g. to amend the latest commit message, reset to its parent and commit again. With hard, the working tree is reset to the commit and every uncommitted change is discarded. Commits orphaned by the reset are not preserved: the frozen repository keeps reachable history only, so a reset cannot be undone by resetting forward again.
§Arguments
commit- Full commit hash to reset HEAD to.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_reset_opts(
&self,
commit: impl Into<String>,
opts: WorkspaceWithResetOpts,
) -> Workspace
pub fn with_reset_opts( &self, commit: impl Into<String>, opts: WorkspaceWithResetOpts, ) -> Workspace
Move this workspace’s Git HEAD to a commit and return the resulting stable workspace. A local workspace is snapshotted automatically before resetting; untracked files require interactive approval. The host checkout is not modified. By default the difference between the previous working tree and the target commit stays uncommitted, as with git reset –mixed, so history can be reworked and reapplied with withCommit — e.g. to amend the latest commit message, reset to its parent and commit again. With hard, the working tree is reset to the commit and every uncommitted change is discarded. Commits orphaned by the reset are not preserved: the frozen repository keeps reachable history only, so a reset cannot be undone by resetting forward again.
§Arguments
commit- Full commit hash to reset HEAD to.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_sdk(&self, ref: impl Into<String>) -> Workspace
pub fn with_sdk(&self, ref: impl Into<String>) -> Workspace
Return this workspace with an SDK installed in its config.
§Arguments
r#ref- SDK module reference to install.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_sdk_opts<'a>(
&self,
ref: impl Into<String>,
opts: WorkspaceWithSdkOpts<'a>,
) -> Workspace
pub fn with_sdk_opts<'a>( &self, ref: impl Into<String>, opts: WorkspaceWithSdkOpts<'a>, ) -> Workspace
Return this workspace with an SDK installed in its config.
§Arguments
r#ref- SDK module reference to install.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_updated_clients(&self) -> Workspace
pub fn with_updated_clients(&self) -> Workspace
Return this workspace with the selected module clients updated. The engine re-reads the source of each selected client target and writes the lock entries that those targets reach. The selected SDK module then regenerates every scope that owns one of the targets.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_updated_clients_opts<'a>(
&self,
opts: WorkspaceWithUpdatedClientsOpts<'a>,
) -> Workspace
pub fn with_updated_clients_opts<'a>( &self, opts: WorkspaceWithUpdatedClientsOpts<'a>, ) -> Workspace
Return this workspace with the selected module clients updated. The engine re-reads the source of each selected client target and writes the lock entries that those targets reach. The selected SDK module then regenerates every scope that owns one of the targets.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_updated_lock(&self) -> Workspace
pub fn with_updated_lock(&self) -> Workspace
Return this workspace with refreshed lockfile state. SDK client scopes are regenerated unless noGenerate is true.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_updated_lock_opts(
&self,
opts: WorkspaceWithUpdatedLockOpts,
) -> Workspace
pub fn with_updated_lock_opts( &self, opts: WorkspaceWithUpdatedLockOpts, ) -> Workspace
Return this workspace with refreshed lockfile state. SDK client scopes are regenerated unless noGenerate is true.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_updated_modules(&self) -> Workspace
pub fn with_updated_modules(&self) -> Workspace
Return this workspace with updated module versions and lockfile state. An SDK client scope is regenerated when it targets an updated module.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_updated_modules_opts<'a>(
&self,
opts: WorkspaceWithUpdatedModulesOpts<'a>,
) -> Workspace
pub fn with_updated_modules_opts<'a>( &self, opts: WorkspaceWithUpdatedModulesOpts<'a>, ) -> Workspace
Return this workspace with updated module versions and lockfile state. An SDK client scope is regenerated when it targets an updated module.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_workdir(&self, path: impl Into<String>) -> Workspace
pub fn with_workdir(&self, path: impl Into<String>) -> Workspace
Return this workspace with its working directory pointed at the given workspace-relative path.
§Arguments
path- Workspace-relative path to use as the working directory.
Sourcepub fn without_client(&self, module: impl Into<String>) -> Workspace
pub fn without_client(&self, module: impl Into<String>) -> Workspace
Return this workspace with a module client removed from the deepest matching recorded scope. Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope. If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
§Arguments
module- The recorded target to remove.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn without_client_opts<'a>(
&self,
module: impl Into<String>,
opts: WorkspaceWithoutClientOpts<'a>,
) -> Workspace
pub fn without_client_opts<'a>( &self, module: impl Into<String>, opts: WorkspaceWithoutClientOpts<'a>, ) -> Workspace
Return this workspace with a module client removed from the deepest matching recorded scope. Fail if several SDKs have that deepest scope. The selected SDK module regenerates the complete scope. If invalid client targets remain, save the removal and skip generation until those targets are corrected or removed.
§Arguments
module- The recorded target to remove.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn without_config_env(&self, name: impl Into<String>) -> Workspace
pub fn without_config_env(&self, name: impl Into<String>) -> Workspace
Return this workspace with a named config environment removed.
§Arguments
name- Environment name.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn without_config_env_opts(
&self,
name: impl Into<String>,
opts: WorkspaceWithoutConfigEnvOpts,
) -> Workspace
pub fn without_config_env_opts( &self, name: impl Into<String>, opts: WorkspaceWithoutConfigEnvOpts, ) -> Workspace
Return this workspace with a named config environment removed.
§Arguments
name- Environment name.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn without_config_value(&self, key: impl Into<String>) -> Workspace
pub fn without_config_value(&self, key: impl Into<String>) -> Workspace
Return this workspace with a configuration value removed. Errors when the key is not currently set. When the session selects an env, the key is scoped to that env’s overlay.
§Arguments
key- Dotted key path (e.g. modules.greeter.settings.greeting).opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn without_config_value_opts(
&self,
key: impl Into<String>,
opts: WorkspaceWithoutConfigValueOpts,
) -> Workspace
pub fn without_config_value_opts( &self, key: impl Into<String>, opts: WorkspaceWithoutConfigValueOpts, ) -> Workspace
Return this workspace with a configuration value removed. Errors when the key is not currently set. When the session selects an env, the key is scoped to that env’s overlay.
§Arguments
key- Dotted key path (e.g. modules.greeter.settings.greeting).opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn without_directory(&self, path: impl Into<String>) -> Workspace
pub fn without_directory(&self, path: impl Into<String>) -> Workspace
Return this workspace with a directory removed, without mutating the source.
§Arguments
path- Path of the directory to remove. Relative paths resolve from the workspace cwd.
Sourcepub fn without_entrypoint(&self) -> Workspace
pub fn without_entrypoint(&self) -> Workspace
Return this workspace with no module selected as its entrypoint.
Sourcepub fn without_file(&self, path: impl Into<String>) -> Workspace
pub fn without_file(&self, path: impl Into<String>) -> Workspace
Return this workspace with a file removed, without mutating the source.
§Arguments
path- Path of the file to remove. Relative paths resolve from the workspace cwd.
Sourcepub fn without_module(&self, name: impl Into<String>) -> Workspace
pub fn without_module(&self, name: impl Into<String>) -> Workspace
Return this workspace with a module removed from its config. When the session selects an env, only that env’s overlay entry is removed.
§Arguments
name- Installed module name or source to remove. Version selectors are not accepted.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn without_module_opts(
&self,
name: impl Into<String>,
opts: WorkspaceWithoutModuleOpts,
) -> Workspace
pub fn without_module_opts( &self, name: impl Into<String>, opts: WorkspaceWithoutModuleOpts, ) -> Workspace
Return this workspace with a module removed from its config. When the session selects an env, only that env’s overlay entry is removed.
§Arguments
name- Installed module name or source to remove. Version selectors are not accepted.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn without_mount(&self, path: impl Into<String>) -> Workspace
pub fn without_mount(&self, path: impl Into<String>) -> Workspace
Return this workspace with the content mounted at the given path unmounted. Removes directory and file mounts at or below the path, revealing the underlying workspace content. Other mounts and pending changes are preserved.
§Arguments
path- Location of the mount to remove. Relative paths resolve from the workspace cwd. Use / to remove all mounts.
Sourcepub fn without_sdk(&self, name: impl Into<String>) -> Workspace
pub fn without_sdk(&self, name: impl Into<String>) -> Workspace
Return this workspace with an SDK removed from its config.
§Arguments
name- Name of the installed SDK entry to remove.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn without_sdk_opts(
&self,
name: impl Into<String>,
opts: WorkspaceWithoutSdkOpts,
) -> Workspace
pub fn without_sdk_opts( &self, name: impl Into<String>, opts: WorkspaceWithoutSdkOpts, ) -> Workspace
Return this workspace with an SDK removed from its config.
§Arguments
name- Name of the installed SDK entry to remove.opt- optional argument, see inner type for documentation, use_opts to use
Trait Implementations§
Source§impl Loadable for Workspace
impl Loadable for Workspace
Source§fn graphql_type() -> &'static str
fn graphql_type() -> &'static str
"Container").Source§fn from_query(
proc: Option<Arc<DaggerSessionProc>>,
selection: Selection,
graphql_client: DynGraphQLClient,
) -> Self
fn from_query( proc: Option<Arc<DaggerSessionProc>>, selection: Selection, graphql_client: DynGraphQLClient, ) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for Workspace
impl !UnwindSafe for Workspace
impl Freeze for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more