Struct dagger_sdk::Function
source · 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 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 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
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)