Skip to main content

Workspace

Struct Workspace 

Source
pub struct Workspace {
    pub proc: Option<Arc<DaggerSessionProc>>,
    pub selection: Selection,
    pub graphql_client: DynGraphQLClient,
}

Fields§

§proc: Option<Arc<DaggerSessionProc>>§selection: Selection§graphql_client: DynGraphQLClient

Implementations§

Source§

impl Workspace

Source

pub async fn address(&self) -> Result<String, DaggerError>

Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.

Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

pub async fn config_file(&self) -> Result<String, DaggerError>

Selected native workspace config file relative to the workspace cwd, if any.

Source

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
Source

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
Source

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.

Source

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.
Source

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
Source

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
Source

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.

Source

pub async fn env_list(&self) -> Result<Vec<String>, DaggerError>

List named environments defined in the workspace configuration.

Source

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.

Source

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.
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

pub fn git(&self) -> WorkspaceGit

Git state for this workspace. Errors if the workspace is not in a git repository.

Source

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”).
Source

pub async fn id(&self) -> Result<Id, DaggerError>

A unique identifier for this Workspace.

Source

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
Source

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
Source

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
Source

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
Source

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.
Source

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.
Source

pub async fn modules(&self) -> Result<Vec<WorkspaceModule>, DaggerError>

List modules defined in the workspace configuration. Reflects the selected env’s effective view.

Source

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.

Source

pub fn sdk(&self, name: impl Into<String>) -> WorkspaceSdk

An installed SDK, by name.

§Arguments
  • name - SDK name to look up.
Source

pub async fn sdks(&self) -> Result<Vec<WorkspaceSdk>, DaggerError>

Installed SDKs.

Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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.
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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.
Source

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.
Source

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
Source

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
Source

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
Source

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
Source

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.

Source

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
Source

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
Source

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.
Source

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.
Source

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.
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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.
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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
Source

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.
Source

pub fn without_entrypoint(&self) -> Workspace

Return this workspace with no module selected as its entrypoint.

Source

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.
Source

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
Source

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
Source

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
Source

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 Clone for Workspace

Source§

fn clone(&self) -> Workspace

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl IntoID<Id> for Workspace

Source§

fn into_id( self, ) -> Pin<Box<dyn Future<Output = Result<Id, DaggerError>> + Send>>

Source§

impl Loadable for Workspace

Source§

fn graphql_type() -> &'static str

The GraphQL type name (e.g. "Container").
Source§

fn from_query( proc: Option<Arc<DaggerSessionProc>>, selection: Selection, graphql_client: DynGraphQLClient, ) -> Self

Construct this type from a query selection.
Source§

impl Node for Workspace

Source§

fn id(&self) -> impl Future<Output = Result<Id, DaggerError>> + Send

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more