pub struct Function {
pub proc: Option<Arc<DaggerSessionProc>>,
pub selection: Selection,
pub graphql_client: DynGraphQLClient,
}
Fields§
§proc: Option<Arc<DaggerSessionProc>>
§selection: Selection
§graphql_client: DynGraphQLClient
Implementations§
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 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_description(&self, description: impl Into<String>) -> Function
pub fn with_description(&self, description: impl Into<String>) -> Function
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.
Trait Implementations§
Source§impl IntoID<FunctionId> for Function
impl IntoID<FunctionId> for Function
fn into_id( self, ) -> Pin<Box<dyn Future<Output = Result<FunctionId, DaggerError>> + Send>>
Auto Trait Implementations§
impl Freeze for Function
impl !RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl !UnwindSafe for Function
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
Mutably borrows from an owned value. Read more