Struct dagger_sdk::Query
source · pub struct Query {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}Fields§
§proc: Option<Arc<DaggerSessionProc>>§selection: Selection§graphql_client: DynGraphQLClientImplementations§
source§impl Query
impl Query
sourcepub fn blob(
&self,
digest: impl Into<String>,
size: isize,
media_type: impl Into<String>,
uncompressed: impl Into<String>,
) -> Directory
pub fn blob( &self, digest: impl Into<String>, size: isize, media_type: impl Into<String>, uncompressed: impl Into<String>, ) -> Directory
Retrieves a content-addressed blob.
§Arguments
digest- Digest of the blobsize- Size of the blobmedia_type- Media type of the blobuncompressed- Digest of the uncompressed blob
sourcepub fn builtin_container(&self, digest: impl Into<String>) -> Container
pub fn builtin_container(&self, digest: impl Into<String>) -> Container
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 fn container(&self) -> Container
pub fn container(&self) -> Container
Creates a scratch container. 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. 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) -> CurrentModule
pub fn current_module(&self) -> CurrentModule
The module currently being served in the session, if any.
sourcepub fn current_type_defs(&self) -> Vec<TypeDef>
pub fn current_type_defs(&self) -> Vec<TypeDef>
The TypeDef representations of the objects currently being served in the session.
sourcepub fn dagger_engine(&self) -> DaggerEngine
pub fn dagger_engine(&self) -> DaggerEngine
The Dagger engine container configuration and state
sourcepub async fn default_platform(&self) -> Result<Platform, DaggerError>
pub async fn default_platform(&self) -> Result<Platform, DaggerError>
The default platform of the engine.
sourcepub fn directory(&self) -> Directory
pub fn directory(&self) -> Directory
Creates an empty directory.
§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.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
pub fn file(&self, id: impl IntoID<FileId>) -> File
sourcepub fn function(
&self,
name: impl Into<String>,
return_type: impl IntoID<TypeDefId>,
) -> Function
pub fn function( &self, name: impl Into<String>, return_type: impl IntoID<TypeDefId>, ) -> Function
Creates a function.
§Arguments
name- Name of the function, in its original format from the implementation language.return_type- Return type of the function.
sourcepub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> GeneratedCode
pub fn generated_code(&self, code: impl IntoID<DirectoryId>) -> 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<'a>(
&self,
url: impl Into<String>,
opts: QueryGitOpts<'a>,
) -> GitRepository
pub fn git_opts<'a>( &self, url: impl Into<String>, opts: QueryGitOpts<'a>, ) -> 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: impl IntoID<CacheVolumeId>,
) -> CacheVolume
pub fn load_cache_volume_from_id( &self, id: impl IntoID<CacheVolumeId>, ) -> CacheVolume
Load a CacheVolume from its ID.
sourcepub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container
pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container
Load a Container from its ID.
sourcepub fn load_current_module_from_id(
&self,
id: impl IntoID<CurrentModuleId>,
) -> CurrentModule
pub fn load_current_module_from_id( &self, id: impl IntoID<CurrentModuleId>, ) -> CurrentModule
Load a CurrentModule from its ID.
sourcepub fn load_dagger_engine_cache_entry_from_id(
&self,
id: impl IntoID<DaggerEngineCacheEntryId>,
) -> DaggerEngineCacheEntry
pub fn load_dagger_engine_cache_entry_from_id( &self, id: impl IntoID<DaggerEngineCacheEntryId>, ) -> DaggerEngineCacheEntry
Load a DaggerEngineCacheEntry from its ID.
sourcepub fn load_dagger_engine_cache_entry_set_from_id(
&self,
id: impl IntoID<DaggerEngineCacheEntrySetId>,
) -> DaggerEngineCacheEntrySet
pub fn load_dagger_engine_cache_entry_set_from_id( &self, id: impl IntoID<DaggerEngineCacheEntrySetId>, ) -> DaggerEngineCacheEntrySet
Load a DaggerEngineCacheEntrySet from its ID.
sourcepub fn load_dagger_engine_cache_from_id(
&self,
id: impl IntoID<DaggerEngineCacheId>,
) -> DaggerEngineCache
pub fn load_dagger_engine_cache_from_id( &self, id: impl IntoID<DaggerEngineCacheId>, ) -> DaggerEngineCache
Load a DaggerEngineCache from its ID.
sourcepub fn load_dagger_engine_from_id(
&self,
id: impl IntoID<DaggerEngineId>,
) -> DaggerEngine
pub fn load_dagger_engine_from_id( &self, id: impl IntoID<DaggerEngineId>, ) -> DaggerEngine
Load a DaggerEngine from its ID.
sourcepub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory
pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory
Load a Directory from its ID.
sourcepub fn load_enum_type_def_from_id(
&self,
id: impl IntoID<EnumTypeDefId>,
) -> EnumTypeDef
pub fn load_enum_type_def_from_id( &self, id: impl IntoID<EnumTypeDefId>, ) -> EnumTypeDef
Load a EnumTypeDef from its ID.
sourcepub fn load_enum_value_type_def_from_id(
&self,
id: impl IntoID<EnumValueTypeDefId>,
) -> EnumValueTypeDef
pub fn load_enum_value_type_def_from_id( &self, id: impl IntoID<EnumValueTypeDefId>, ) -> EnumValueTypeDef
Load a EnumValueTypeDef from its ID.
sourcepub fn load_env_variable_from_id(
&self,
id: impl IntoID<EnvVariableId>,
) -> EnvVariable
pub fn load_env_variable_from_id( &self, id: impl IntoID<EnvVariableId>, ) -> EnvVariable
Load a EnvVariable from its ID.
sourcepub fn load_field_type_def_from_id(
&self,
id: impl IntoID<FieldTypeDefId>,
) -> FieldTypeDef
pub fn load_field_type_def_from_id( &self, id: impl IntoID<FieldTypeDefId>, ) -> FieldTypeDef
Load a FieldTypeDef from its ID.
sourcepub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File
pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File
Load a File from its ID.
sourcepub fn load_function_arg_from_id(
&self,
id: impl IntoID<FunctionArgId>,
) -> FunctionArg
pub fn load_function_arg_from_id( &self, id: impl IntoID<FunctionArgId>, ) -> FunctionArg
Load a FunctionArg from its ID.
sourcepub fn load_function_call_arg_value_from_id(
&self,
id: impl IntoID<FunctionCallArgValueId>,
) -> FunctionCallArgValue
pub fn load_function_call_arg_value_from_id( &self, id: impl IntoID<FunctionCallArgValueId>, ) -> FunctionCallArgValue
Load a FunctionCallArgValue from its ID.
sourcepub fn load_function_call_from_id(
&self,
id: impl IntoID<FunctionCallId>,
) -> FunctionCall
pub fn load_function_call_from_id( &self, id: impl IntoID<FunctionCallId>, ) -> FunctionCall
Load a FunctionCall from its ID.
sourcepub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function
pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function
Load a Function from its ID.
sourcepub fn load_generated_code_from_id(
&self,
id: impl IntoID<GeneratedCodeId>,
) -> GeneratedCode
pub fn load_generated_code_from_id( &self, id: impl IntoID<GeneratedCodeId>, ) -> GeneratedCode
Load a GeneratedCode from its ID.
sourcepub fn load_git_module_source_from_id(
&self,
id: impl IntoID<GitModuleSourceId>,
) -> GitModuleSource
pub fn load_git_module_source_from_id( &self, id: impl IntoID<GitModuleSourceId>, ) -> GitModuleSource
Load a GitModuleSource from its ID.
sourcepub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef
pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef
Load a GitRef from its ID.
sourcepub fn load_git_repository_from_id(
&self,
id: impl IntoID<GitRepositoryId>,
) -> GitRepository
pub fn load_git_repository_from_id( &self, id: impl IntoID<GitRepositoryId>, ) -> GitRepository
Load a GitRepository from its ID.
sourcepub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host
pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host
Load a Host from its ID.
sourcepub fn load_input_type_def_from_id(
&self,
id: impl IntoID<InputTypeDefId>,
) -> InputTypeDef
pub fn load_input_type_def_from_id( &self, id: impl IntoID<InputTypeDefId>, ) -> InputTypeDef
Load a InputTypeDef from its ID.
sourcepub fn load_interface_type_def_from_id(
&self,
id: impl IntoID<InterfaceTypeDefId>,
) -> InterfaceTypeDef
pub fn load_interface_type_def_from_id( &self, id: impl IntoID<InterfaceTypeDefId>, ) -> InterfaceTypeDef
Load a InterfaceTypeDef from its ID.
sourcepub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label
pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label
Load a Label from its ID.
sourcepub fn load_list_type_def_from_id(
&self,
id: impl IntoID<ListTypeDefId>,
) -> ListTypeDef
pub fn load_list_type_def_from_id( &self, id: impl IntoID<ListTypeDefId>, ) -> ListTypeDef
Load a ListTypeDef from its ID.
sourcepub fn load_local_module_source_from_id(
&self,
id: impl IntoID<LocalModuleSourceId>,
) -> LocalModuleSource
pub fn load_local_module_source_from_id( &self, id: impl IntoID<LocalModuleSourceId>, ) -> LocalModuleSource
Load a LocalModuleSource from its ID.
sourcepub fn load_module_dependency_from_id(
&self,
id: impl IntoID<ModuleDependencyId>,
) -> ModuleDependency
pub fn load_module_dependency_from_id( &self, id: impl IntoID<ModuleDependencyId>, ) -> ModuleDependency
Load a ModuleDependency from its ID.
sourcepub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module
pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module
Load a Module from its ID.
sourcepub fn load_module_source_from_id(
&self,
id: impl IntoID<ModuleSourceId>,
) -> ModuleSource
pub fn load_module_source_from_id( &self, id: impl IntoID<ModuleSourceId>, ) -> ModuleSource
Load a ModuleSource from its ID.
sourcepub fn load_module_source_view_from_id(
&self,
id: impl IntoID<ModuleSourceViewId>,
) -> ModuleSourceView
pub fn load_module_source_view_from_id( &self, id: impl IntoID<ModuleSourceViewId>, ) -> ModuleSourceView
Load a ModuleSourceView from its ID.
sourcepub fn load_object_type_def_from_id(
&self,
id: impl IntoID<ObjectTypeDefId>,
) -> ObjectTypeDef
pub fn load_object_type_def_from_id( &self, id: impl IntoID<ObjectTypeDefId>, ) -> ObjectTypeDef
Load a ObjectTypeDef from its ID.
sourcepub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port
pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port
Load a Port from its ID.
sourcepub fn load_scalar_type_def_from_id(
&self,
id: impl IntoID<ScalarTypeDefId>,
) -> ScalarTypeDef
pub fn load_scalar_type_def_from_id( &self, id: impl IntoID<ScalarTypeDefId>, ) -> ScalarTypeDef
Load a ScalarTypeDef from its ID.
sourcepub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret
pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret
Load a Secret from its ID.
sourcepub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service
pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service
Load a Service from its ID.
sourcepub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket
pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket
Load a Socket from its ID.
sourcepub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal
pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal
Load a Terminal from its ID.
sourcepub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef
pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef
Load a TypeDef from its ID.
sourcepub fn module_dependency(
&self,
source: impl IntoID<ModuleSourceId>,
) -> ModuleDependency
pub fn module_dependency( &self, source: impl IntoID<ModuleSourceId>, ) -> ModuleDependency
Create a new module dependency configuration from a module source and name
§Arguments
source- The source of the dependencyopt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn module_dependency_opts<'a>(
&self,
source: impl IntoID<ModuleSourceId>,
opts: QueryModuleDependencyOpts<'a>,
) -> ModuleDependency
pub fn module_dependency_opts<'a>( &self, source: impl IntoID<ModuleSourceId>, opts: QueryModuleDependencyOpts<'a>, ) -> ModuleDependency
Create a new module dependency configuration from a module source and name
§Arguments
source- The source of the dependencyopt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource
pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource
Create a new module source instance from a source ref string.
§Arguments
ref_string- The string ref representation of the module sourceopt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn module_source_opts(
&self,
ref_string: impl Into<String>,
opts: QueryModuleSourceOpts,
) -> ModuleSource
pub fn module_source_opts( &self, ref_string: impl Into<String>, opts: QueryModuleSourceOpts, ) -> ModuleSource
Create a new module source instance from a source ref string.
§Arguments
ref_string- The string ref representation of the module sourceopt- 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- Name of the sub-pipeline.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- Name of the sub-pipeline.opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn secret(&self, name: impl Into<String>) -> Secret
pub fn secret(&self, name: impl Into<String>) -> Secret
Reference a secret by name.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn secret_opts<'a>(
&self,
name: impl Into<String>,
opts: QuerySecretOpts<'a>,
) -> Secret
pub fn secret_opts<'a>( &self, name: impl Into<String>, opts: QuerySecretOpts<'a>, ) -> Secret
Reference a secret by name.
§Arguments
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 async fn version(&self) -> Result<String, DaggerError>
pub async fn version(&self) -> Result<String, DaggerError>
Get the current Dagger Engine version.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Query
impl !RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl !UnwindSafe for Query
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)