Struct dagger_sdk::Query
source · pub struct Query {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}Fields§
§proc: Option<Arc<Child>>§selection: Selection§graphql_client: DynGraphQLClientImplementations§
source§impl Query
impl Query
sourcepub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume
pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume
Constructs a cache volume for a given cache key.
Arguments
key- A string identifier to target this cache volume (e.g., “modules-cache”).
sourcepub async fn check_version_compatibility(
&self,
version: impl Into<String>
) -> Result<bool, DaggerError>
pub async fn check_version_compatibility( &self, version: impl Into<String> ) -> Result<bool, DaggerError>
Checks if the current Dagger Engine is compatible with an SDK’s required version.
Arguments
version- The SDK’s required version.
sourcepub fn container(&self) -> Container
pub fn container(&self) -> Container
Creates a scratch container or loads one by ID. Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder’s host.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn container_opts(&self, opts: QueryContainerOpts) -> Container
pub fn container_opts(&self, opts: QueryContainerOpts) -> Container
Creates a scratch container or loads one by ID. Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder’s host.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn current_function_call(&self) -> FunctionCall
pub fn current_function_call(&self) -> FunctionCall
The FunctionCall context that the SDK caller is currently executing in. If the caller is not currently executing in a function, this will return an error.
sourcepub fn current_module(&self) -> Module
pub fn current_module(&self) -> Module
The module currently being served in the session, if any.
sourcepub async fn default_platform(&self) -> Result<Platform, DaggerError>
pub async fn default_platform(&self) -> Result<Platform, DaggerError>
The default platform of the builder.
sourcepub fn directory(&self) -> Directory
pub fn directory(&self) -> Directory
Creates an empty directory or loads one by ID.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn directory_opts(&self, opts: QueryDirectoryOpts) -> Directory
pub fn directory_opts(&self, opts: QueryDirectoryOpts) -> Directory
Creates an empty directory or loads one by ID.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn function(
&self,
name: impl Into<String>,
return_type: TypeDef
) -> Function
pub fn function( &self, name: impl Into<String>, return_type: TypeDef ) -> Function
Create a function.
sourcepub fn generated_code(&self, code: Directory) -> GeneratedCode
pub fn generated_code(&self, code: Directory) -> GeneratedCode
Create a code generation result, given a directory containing the generated code.
sourcepub fn git(&self, url: impl Into<String>) -> GitRepository
pub fn git(&self, url: impl Into<String>) -> GitRepository
Queries a git repository.
Arguments
url- Url of the git repository. Can be formatted as https://{host}/{owner}/{repo}, git@{host}/{owner}/{repo} Suffix “.git” is optional.opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn git_opts(
&self,
url: impl Into<String>,
opts: QueryGitOpts
) -> GitRepository
pub fn git_opts( &self, url: impl Into<String>, opts: QueryGitOpts ) -> GitRepository
Queries a git repository.
Arguments
url- Url of the git repository. Can be formatted as https://{host}/{owner}/{repo}, git@{host}/{owner}/{repo} Suffix “.git” is optional.opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn http(&self, url: impl Into<String>) -> File
pub fn http(&self, url: impl Into<String>) -> File
Returns a file containing an http remote url content.
Arguments
url- HTTP url to get the content from (e.g., “https://docs.dagger.io”).opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File
pub fn http_opts(&self, url: impl Into<String>, opts: QueryHttpOpts) -> File
Returns a file containing an http remote url content.
Arguments
url- HTTP url to get the content from (e.g., “https://docs.dagger.io”).opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn load_cache_volume_from_id(&self, id: CacheVolume) -> CacheVolume
pub fn load_cache_volume_from_id(&self, id: CacheVolume) -> CacheVolume
Load a CacheVolume from its ID.
sourcepub fn load_container_from_id(&self, id: Container) -> Container
pub fn load_container_from_id(&self, id: Container) -> Container
Loads a container from an ID.
sourcepub fn load_directory_from_id(&self, id: Directory) -> Directory
pub fn load_directory_from_id(&self, id: Directory) -> Directory
Load a Directory from its ID.
sourcepub fn load_file_from_id(&self, id: File) -> File
pub fn load_file_from_id(&self, id: File) -> File
Load a File from its ID.
sourcepub fn load_function_arg_from_id(&self, id: FunctionArg) -> FunctionArg
pub fn load_function_arg_from_id(&self, id: FunctionArg) -> FunctionArg
Load a function argument by ID.
sourcepub fn load_function_from_id(&self, id: Function) -> Function
pub fn load_function_from_id(&self, id: Function) -> Function
Load a function by ID.
sourcepub fn load_generated_code_from_id(&self, id: GeneratedCode) -> GeneratedCode
pub fn load_generated_code_from_id(&self, id: GeneratedCode) -> GeneratedCode
Load a GeneratedCode by ID.
sourcepub fn load_module_from_id(&self, id: Module) -> Module
pub fn load_module_from_id(&self, id: Module) -> Module
Load a module by ID.
sourcepub fn load_secret_from_id(&self, id: Secret) -> Secret
pub fn load_secret_from_id(&self, id: Secret) -> Secret
Load a Secret from its ID.
sourcepub fn load_service_from_id(&self, id: Service) -> Service
pub fn load_service_from_id(&self, id: Service) -> Service
Loads a service from ID.
sourcepub fn load_socket_from_id(&self, id: Socket) -> Socket
pub fn load_socket_from_id(&self, id: Socket) -> Socket
Load a Socket from its ID.
sourcepub fn load_type_def_from_id(&self, id: TypeDef) -> TypeDef
pub fn load_type_def_from_id(&self, id: TypeDef) -> TypeDef
Load a TypeDef by ID.
sourcepub fn module_config(&self, source_directory: Directory) -> ModuleConfig
pub fn module_config(&self, source_directory: Directory) -> ModuleConfig
Load the static configuration for a module from the given source directory and optional subpath.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn module_config_opts<'a>(
&self,
source_directory: Directory,
opts: QueryModuleConfigOpts<'a>
) -> ModuleConfig
pub fn module_config_opts<'a>( &self, source_directory: Directory, opts: QueryModuleConfigOpts<'a> ) -> ModuleConfig
Load the static configuration for a module from the given source directory and optional subpath.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn pipeline(&self, name: impl Into<String>) -> Query
pub fn pipeline(&self, name: impl Into<String>) -> Query
Creates a named sub-pipeline.
Arguments
name- Pipeline name.opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn pipeline_opts<'a>(
&self,
name: impl Into<String>,
opts: QueryPipelineOpts<'a>
) -> Query
pub fn pipeline_opts<'a>( &self, name: impl Into<String>, opts: QueryPipelineOpts<'a> ) -> Query
Creates a named sub-pipeline.
Arguments
name- Pipeline name.opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn set_secret(
&self,
name: impl Into<String>,
plaintext: impl Into<String>
) -> Secret
pub fn set_secret( &self, name: impl Into<String>, plaintext: impl Into<String> ) -> Secret
Sets a secret given a user defined name to its plaintext and returns the secret. The plaintext value is limited to a size of 128000 bytes.
Arguments
name- The user defined name for this secretplaintext- The plaintext of the secret
sourcepub fn socket(&self) -> Socket
pub fn socket(&self) -> Socket
Loads a socket by its ID.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn socket_opts(&self, opts: QuerySocketOpts) -> Socket
pub fn socket_opts(&self, opts: QuerySocketOpts) -> Socket
Loads a socket by its ID.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use