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
Source§impl Query
impl Query
Sourcepub fn address(&self, value: impl Into<String>) -> Address
pub fn address(&self, value: impl Into<String>) -> Address
initialize an address to load directories, containers, secrets or other object types.
Sourcepub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File
pub fn blob(&self, name: impl Into<String>, contents: Bytes) -> File
Creates a file from arbitrary binary contents.
§Arguments
name- Name of the new file. Example: “archive.tar”contents- Binary contents of the new file, encoded as base64 at the GraphQL boundary.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn blob_opts(
&self,
name: impl Into<String>,
contents: Bytes,
opts: QueryBlobOpts,
) -> File
pub fn blob_opts( &self, name: impl Into<String>, contents: Bytes, opts: QueryBlobOpts, ) -> File
Creates a file from arbitrary binary contents.
§Arguments
name- Name of the new file. Example: “archive.tar”contents- Binary contents of the new file, encoded as base64 at the GraphQL boundary.opt- optional argument, see inner type for documentation, use_opts to use
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”).opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn cache_volume_opts<'a>(
&self,
key: impl Into<String>,
opts: QueryCacheVolumeOpts<'a>,
) -> CacheVolume
pub fn cache_volume_opts<'a>( &self, key: impl Into<String>, opts: QueryCacheVolumeOpts<'a>, ) -> CacheVolume
Constructs a cache volume for a given cache key.
§Arguments
key- A string identifier to target this cache volume (e.g., “modules-cache”).opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn container(&self) -> Container
pub fn container(&self) -> Container
Creates a scratch container, with no image or metadata. To pull an image, follow up with the “from” function.
§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, with no image or metadata. To pull an image, follow up with the “from” function.
§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_node(&self) -> NodeClient
pub fn current_node(&self) -> NodeClient
The object that received the current module function call, as a Node. Errors when there is no current call, or the call is top-level (e.g. a module constructor).
Sourcepub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError>
pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError>
The TypeDef representations of the objects currently being served in the session.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn current_type_defs_opts(
&self,
opts: QueryCurrentTypeDefsOpts,
) -> Result<Vec<TypeDef>, DaggerError>
pub async fn current_type_defs_opts( &self, opts: QueryCurrentTypeDefsOpts, ) -> Result<Vec<TypeDef>, DaggerError>
The TypeDef representations of the objects currently being served in the session.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn current_workspace(&self) -> Workspace
pub fn current_workspace(&self) -> Workspace
Detect and return the current workspace.
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 engine_volume(&self, name: impl Into<String>) -> Volume
pub fn engine_volume(&self, name: impl Into<String>) -> Volume
Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
§Arguments
name- Canonical slash-separated volume name beneath the engine volume namespace.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn engine_volume_opts<'a>(
&self,
name: impl Into<String>,
opts: QueryEngineVolumeOpts<'a>,
) -> Volume
pub fn engine_volume_opts<'a>( &self, name: impl Into<String>, opts: QueryEngineVolumeOpts<'a>, ) -> Volume
Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.
§Arguments
name- Canonical slash-separated volume name beneath the engine volume namespace.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn env_file(&self) -> EnvFile
pub fn env_file(&self) -> EnvFile
Initialize an environment file
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile
pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile
Initialize an environment file
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File
pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File
Creates a file with the specified contents.
§Arguments
name- Name of the new file. Example: “foo.txt”contents- Contents of the new file. Example: “Hello world!”opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn file_opts(
&self,
name: impl Into<String>,
contents: impl Into<String>,
opts: QueryFileOpts,
) -> File
pub fn file_opts( &self, name: impl Into<String>, contents: impl Into<String>, opts: QueryFileOpts, ) -> File
Creates a file with the specified contents.
§Arguments
name- Name of the new file. Example: “foo.txt”contents- Contents of the new file. Example: “Hello world!”opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn function(
&self,
name: impl Into<String>,
return_type: impl IntoID<Id>,
) -> Function
pub fn function( &self, name: impl Into<String>, return_type: impl IntoID<Id>, ) -> 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<Id>) -> GeneratedCode
pub fn generated_code(&self, code: impl IntoID<Id>) -> 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<'a>(
&self,
url: impl Into<String>,
opts: QueryHttpOpts<'a>,
) -> File
pub fn http_opts<'a>( &self, url: impl Into<String>, opts: QueryHttpOpts<'a>, ) -> 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 async fn id(&self) -> Result<Id, DaggerError>
pub async fn id(&self) -> Result<Id, DaggerError>
A unique identifier for this Query.
Sourcepub fn llm(&self) -> Llm
pub fn llm(&self) -> Llm
Initialize a new LLM conversation.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm
pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm
Initialize a new LLM conversation.
§Arguments
opt- 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<'a>(
&self,
ref_string: impl Into<String>,
opts: QueryModuleSourceOpts<'a>,
) -> ModuleSource
pub fn module_source_opts<'a>( &self, ref_string: impl Into<String>, opts: QueryModuleSourceOpts<'a>, ) -> 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 async fn node(
&self,
id: impl IntoID<Id>,
) -> Result<Option<NodeClient>, DaggerError>
pub async fn node( &self, id: impl IntoID<Id>, ) -> Result<Option<NodeClient>, DaggerError>
Load any object by its ID.
Sourcepub fn schema(&self, json: Json) -> Schema
pub fn schema(&self, json: Json) -> Schema
Load a GraphQL introspection schema for merging.
§Arguments
json- The introspection schema JSON to load.
Sourcepub fn secret(&self, uri: impl Into<String>) -> Secret
pub fn secret(&self, uri: impl Into<String>) -> Secret
Creates a new secret.
§Arguments
uri- The URI of the secret storeopt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn secret_opts<'a>(
&self,
uri: impl Into<String>,
opts: QuerySecretOpts<'a>,
) -> Secret
pub fn secret_opts<'a>( &self, uri: impl Into<String>, opts: QuerySecretOpts<'a>, ) -> Secret
Creates a new secret.
§Arguments
uri- The URI of the secret storeopt- 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 source_map(
&self,
filename: impl Into<String>,
line: isize,
column: isize,
) -> SourceMap
pub fn source_map( &self, filename: impl Into<String>, line: isize, column: isize, ) -> SourceMap
Creates source map metadata.
§Arguments
filename- The filename from the module source.line- The line number within the filename.column- The column number within the line.
Sourcepub fn sshfs_volume(
&self,
endpoint: impl Into<String>,
private_key: impl IntoID<Id>,
) -> Volume
pub fn sshfs_volume( &self, endpoint: impl Into<String>, private_key: impl IntoID<Id>, ) -> Volume
Constructs an SSHFS volume.
§Arguments
endpoint- SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.private_key- Private key secret used to authenticate to the remote host.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn sshfs_volume_opts<'a>(
&self,
endpoint: impl Into<String>,
private_key: impl IntoID<Id>,
opts: QuerySshfsVolumeOpts<'a>,
) -> Volume
pub fn sshfs_volume_opts<'a>( &self, endpoint: impl Into<String>, private_key: impl IntoID<Id>, opts: QuerySshfsVolumeOpts<'a>, ) -> Volume
Constructs an SSHFS volume.
§Arguments
endpoint- SSHFS endpoint URL in the form sshfs://user@host[:port]/absolute/path.private_key- Private key secret used to authenticate to the remote host.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub async fn version(&self) -> Result<String, DaggerError>
pub async fn version(&self) -> Result<String, DaggerError>
Get the current Dagger Engine version.
Trait Implementations§
Source§impl Loadable for Query
impl Loadable for Query
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 Query
impl !UnwindSafe for Query
impl Freeze for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin 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§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