Struct dagger_sdk::Function
source · pub struct Function {
pub proc: Option<Arc<Child>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}Fields§
§proc: Option<Arc<Child>>§selection: Selection§graphql_client: DynGraphQLClientImplementations§
source§impl Function
impl Function
sourcepub fn args(&self) -> Vec<FunctionArg>
pub fn args(&self) -> Vec<FunctionArg>
Arguments accepted by this function, if any
sourcepub async fn call(&self) -> Result<Json, DaggerError>
pub async fn call(&self) -> Result<Json, DaggerError>
Execute this function using dynamic input+output types. Typically, it’s preferable to invoke a function using a type safe graphql query rather than using this call field. However, call is useful for some advanced use cases where dynamically loading arbitrary modules and invoking functions in them is required.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub async fn call_opts(
&self,
opts: FunctionCallOpts
) -> Result<Json, DaggerError>
pub async fn call_opts( &self, opts: FunctionCallOpts ) -> Result<Json, DaggerError>
Execute this function using dynamic input+output types. Typically, it’s preferable to invoke a function using a type safe graphql query rather than using this call field. However, call is useful for some advanced use cases where dynamically loading arbitrary modules and invoking functions in them is required.
Arguments
opt- optional argument, see inner type for documentation, use_opts to use
sourcepub async fn description(&self) -> Result<String, DaggerError>
pub async fn description(&self) -> Result<String, DaggerError>
A doc string for the function, if any
sourcepub async fn id(&self) -> Result<FunctionId, DaggerError>
pub async fn id(&self) -> Result<FunctionId, DaggerError>
The ID of the function
sourcepub async fn name(&self) -> Result<String, DaggerError>
pub async fn name(&self) -> Result<String, DaggerError>
The name of the function
sourcepub fn return_type(&self) -> TypeDef
pub fn return_type(&self) -> TypeDef
The type returned by this function
sourcepub fn with_arg(&self, name: impl Into<String>, type_def: TypeDef) -> Function
pub fn with_arg(&self, name: impl Into<String>, type_def: TypeDef) -> Function
Returns the function with the provided argument
Arguments
name- The name of the argumenttype_def- The type of the argumentopt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn with_arg_opts<'a>(
&self,
name: impl Into<String>,
type_def: TypeDef,
opts: FunctionWithArgOpts<'a>
) -> Function
pub fn with_arg_opts<'a>( &self, name: impl Into<String>, type_def: TypeDef, opts: FunctionWithArgOpts<'a> ) -> Function
Returns the function with the provided argument
Arguments
name- The name of the argumenttype_def- The type of the argumentopt- optional argument, see inner type for documentation, use_opts to use
sourcepub fn with_description(&self, description: impl Into<String>) -> Function
pub fn with_description(&self, description: impl Into<String>) -> Function
Returns the function with the doc string