pub struct Function {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}Fields§
§proc: Option<Arc<DaggerSessionProc>>§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 the function, if any.
Sourcepub async fn deprecated(&self) -> Result<String, DaggerError>
pub async fn deprecated(&self) -> Result<String, DaggerError>
The reason this function is deprecated, if any.
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>
A unique identifier for this 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 the function.
Sourcepub fn source_map(&self) -> SourceMap
pub fn source_map(&self) -> SourceMap
The location of this function declaration.
Sourcepub fn with_arg(
&self,
name: impl Into<String>,
type_def: impl IntoID<TypeDefId>,
) -> Function
pub fn with_arg( &self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>, ) -> 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: impl IntoID<TypeDefId>,
opts: FunctionWithArgOpts<'a>,
) -> Function
pub fn with_arg_opts<'a>( &self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>, 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_cache_policy(&self, policy: FunctionCachePolicy) -> Function
pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function
Returns the function updated to use the provided cache policy.
§Arguments
policy- The cache policy to use.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_cache_policy_opts<'a>(
&self,
policy: FunctionCachePolicy,
opts: FunctionWithCachePolicyOpts<'a>,
) -> Function
pub fn with_cache_policy_opts<'a>( &self, policy: FunctionCachePolicy, opts: FunctionWithCachePolicyOpts<'a>, ) -> Function
Returns the function updated to use the provided cache policy.
§Arguments
policy- The cache policy to use.opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_check(&self) -> Function
pub fn with_check(&self) -> Function
Returns the function with a flag indicating it’s a check.
Sourcepub fn with_deprecated(&self) -> Function
pub fn with_deprecated(&self) -> Function
Returns the function with the provided deprecation reason.
§Arguments
opt- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_deprecated_opts<'a>(
&self,
opts: FunctionWithDeprecatedOpts<'a>,
) -> Function
pub fn with_deprecated_opts<'a>( &self, opts: FunctionWithDeprecatedOpts<'a>, ) -> Function
Returns the function with the provided deprecation reason.
§Arguments
opt- 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
Sourcepub fn with_generator(&self) -> Function
pub fn with_generator(&self) -> Function
Returns the function with a flag indicating it’s a generator.
Sourcepub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function
pub fn with_source_map(&self, source_map: impl IntoID<SourceMapId>) -> Function
Returns the function with the given source map.
§Arguments
source_map- The source map for the function definition.