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) -> AgentGroup
pub fn agents(&self) -> AgentGroup
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>) -> AgentGroup
pub fn agents_opts<'a>(&self, opts: WorkspaceAgentsOpts<'a>) -> AgentGroup
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 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 pending changes to its local Git workspace on the current client’s host. Like Directory.export, the write is a side effect on the client that makes the call — never on the client that created the workspace. Inside a module, this cannot reach the caller’s host.
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 reloaded(&self) -> Workspace
pub fn reloaded(&self) -> Workspace
Return this workspace with its cached host reads invalidated, so subsequent file and directory reads re-read the live host instead of a snapshot cached earlier in the session.
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 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_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_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_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_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