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 client_id(&self) -> Result<String, DaggerError>
pub async fn client_id(&self) -> Result<String, DaggerError>
The client ID that owns this workspace’s host filesystem.
Sourcepub fn directory(&self, path: impl Into<String>) -> Directory
pub fn directory(&self, path: impl Into<String>) -> Directory
Returns a Directory from the workspace. Path is relative to workspace root. Use “.” for the root directory.
§Arguments
path- Location of the directory to retrieve, relative to the workspace root (e.g., “src”, “.”).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. Path is relative to workspace root. Use “.” for the root directory.
§Arguments
path- Location of the directory to retrieve, relative to the workspace root (e.g., “src”, “.”).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. Path is relative to workspace root.
§Arguments
path- Location of the file to retrieve, relative to the workspace root (e.g., “go.mod”).
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 path relative to the workspace root if found, or null if not found. 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 path relative to the workspace root if found, or null if not found. 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 id(&self) -> Result<WorkspaceId, DaggerError>
pub async fn id(&self) -> Result<WorkspaceId, DaggerError>
A unique identifier for this Workspace.
Sourcepub async fn root(&self) -> Result<String, DaggerError>
pub async fn root(&self) -> Result<String, DaggerError>
Absolute path to the workspace root directory.