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: DynGraphQLClient

Implementations§

source§

impl Query

source

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

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

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
source

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
source

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.

source

pub fn current_module(&self) -> Module

The module currently being served in the session, if any.

source

pub async fn default_platform(&self) -> Result<Platform, DaggerError>

The default platform of the builder.

source

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
source

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
source

pub fn file(&self, id: File) -> File

Loads a file by ID.

source

pub fn function( &self, name: impl Into<String>, return_type: TypeDef ) -> Function

Create a function.

source

pub fn generated_code(&self, code: Directory) -> GeneratedCode

Create a code generation result, given a directory containing the generated code.

source

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
source

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
source

pub fn host(&self) -> Host

Queries the host environment.

source

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
source

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
source

pub fn load_cache_volume_from_id(&self, id: CacheVolume) -> CacheVolume

Load a CacheVolume from its ID.

source

pub fn load_container_from_id(&self, id: Container) -> Container

Loads a container from an ID.

source

pub fn load_directory_from_id(&self, id: Directory) -> Directory

Load a Directory from its ID.

source

pub fn load_file_from_id(&self, id: File) -> File

Load a File from its ID.

source

pub fn load_function_arg_from_id(&self, id: FunctionArg) -> FunctionArg

Load a function argument by ID.

source

pub fn load_function_from_id(&self, id: Function) -> Function

Load a function by ID.

source

pub fn load_generated_code_from_id(&self, id: GeneratedCode) -> GeneratedCode

Load a GeneratedCode by ID.

source

pub fn load_module_from_id(&self, id: Module) -> Module

Load a module by ID.

source

pub fn load_secret_from_id(&self, id: Secret) -> Secret

Load a Secret from its ID.

source

pub fn load_service_from_id(&self, id: Service) -> Service

Loads a service from ID.

source

pub fn load_socket_from_id(&self, id: Socket) -> Socket

Load a Socket from its ID.

source

pub fn load_type_def_from_id(&self, id: TypeDef) -> TypeDef

Load a TypeDef by ID.

source

pub fn module(&self) -> Module

Create a new module.

source

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
source

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
source

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
source

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
source

pub fn secret(&self, id: Secret) -> Secret

Loads a secret from its ID.

source

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 secret
  • plaintext - The plaintext of the secret
source

pub fn socket(&self) -> Socket

Loads a socket by its ID.

Arguments
  • opt - optional argument, see inner type for documentation, use _opts to use
source

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
source

pub fn type_def(&self) -> TypeDef

Create a new TypeDef.

Trait Implementations§

source§

impl Clone for Query

source§

fn clone(&self) -> Query

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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