Struct TypeDef

Source
pub struct TypeDef {
    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 TypeDef

Source

pub fn as_enum(&self) -> EnumTypeDef

If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.

Source

pub fn as_input(&self) -> InputTypeDef

If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.

Source

pub fn as_interface(&self) -> InterfaceTypeDef

If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.

Source

pub fn as_list(&self) -> ListTypeDef

If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.

Source

pub fn as_object(&self) -> ObjectTypeDef

If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.

Source

pub fn as_scalar(&self) -> ScalarTypeDef

If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.

Source

pub async fn id(&self) -> Result<TypeDefId, DaggerError>

A unique identifier for this TypeDef.

Source

pub async fn kind(&self) -> Result<TypeDefKind, DaggerError>

The kind of type this is (e.g. primitive, list, object).

Source

pub async fn optional(&self) -> Result<bool, DaggerError>

Whether this type can be set to null. Defaults to false.

Source

pub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef

Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.

Source

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

Returns a TypeDef of kind Enum with the provided name. Note that an enum’s values may be omitted if the intent is only to refer to an enum. This is how functions are able to return their own, or any other circular reference.

§Arguments
  • name - The name of the enum
  • opt - optional argument, see inner type for documentation, use _opts to use
Source

pub fn with_enum_opts<'a>( &self, name: impl Into<String>, opts: TypeDefWithEnumOpts<'a>, ) -> TypeDef

Returns a TypeDef of kind Enum with the provided name. Note that an enum’s values may be omitted if the intent is only to refer to an enum. This is how functions are able to return their own, or any other circular reference.

§Arguments
  • name - The name of the enum
  • opt - optional argument, see inner type for documentation, use _opts to use
Source

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

Adds a static value for an Enum TypeDef, failing if the type is not an enum.

§Arguments
  • name - The name of the member in the enum
  • opt - optional argument, see inner type for documentation, use _opts to use
Source

pub fn with_enum_member_opts<'a>( &self, name: impl Into<String>, opts: TypeDefWithEnumMemberOpts<'a>, ) -> TypeDef

Adds a static value for an Enum TypeDef, failing if the type is not an enum.

§Arguments
  • name - The name of the member in the enum
  • opt - optional argument, see inner type for documentation, use _opts to use
Source

pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef

Adds a static value for an Enum TypeDef, failing if the type is not an enum.

§Arguments
  • value - The name of the value in the enum
  • opt - optional argument, see inner type for documentation, use _opts to use
Source

pub fn with_enum_value_opts<'a>( &self, value: impl Into<String>, opts: TypeDefWithEnumValueOpts<'a>, ) -> TypeDef

Adds a static value for an Enum TypeDef, failing if the type is not an enum.

§Arguments
  • value - The name of the value in the enum
  • opt - optional argument, see inner type for documentation, use _opts to use
Source

pub fn with_field( &self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>, ) -> TypeDef

Adds a static field for an Object TypeDef, failing if the type is not an object.

§Arguments
  • name - The name of the field in the object
  • type_def - The type of the field
  • opt - optional argument, see inner type for documentation, use _opts to use
Source

pub fn with_field_opts<'a>( &self, name: impl Into<String>, type_def: impl IntoID<TypeDefId>, opts: TypeDefWithFieldOpts<'a>, ) -> TypeDef

Adds a static field for an Object TypeDef, failing if the type is not an object.

§Arguments
  • name - The name of the field in the object
  • type_def - The type of the field
  • opt - optional argument, see inner type for documentation, use _opts to use
Source

pub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef

Adds a function for an Object or Interface TypeDef, failing if the type is not one of those kinds.

Source

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

Returns a TypeDef of kind Interface with the provided name.

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

pub fn with_interface_opts<'a>( &self, name: impl Into<String>, opts: TypeDefWithInterfaceOpts<'a>, ) -> TypeDef

Returns a TypeDef of kind Interface with the provided name.

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

pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef

Sets the kind of the type.

Source

pub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef

Returns a TypeDef of kind List with the provided type for its elements.

Source

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

Returns a TypeDef of kind Object with the provided name. Note that an object’s fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.

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

pub fn with_object_opts<'a>( &self, name: impl Into<String>, opts: TypeDefWithObjectOpts<'a>, ) -> TypeDef

Returns a TypeDef of kind Object with the provided name. Note that an object’s fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.

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

pub fn with_optional(&self, optional: bool) -> TypeDef

Sets whether this type can be set to null.

Source

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

Returns a TypeDef of kind Scalar with the provided name.

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

pub fn with_scalar_opts<'a>( &self, name: impl Into<String>, opts: TypeDefWithScalarOpts<'a>, ) -> TypeDef

Returns a TypeDef of kind Scalar with the provided name.

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

Trait Implementations§

Source§

impl Clone for TypeDef

Source§

fn clone(&self) -> TypeDef

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl IntoID<TypeDefId> for TypeDef

Source§

fn into_id( self, ) -> Pin<Box<dyn Future<Output = Result<TypeDefId, DaggerError>> + Send>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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
Source§

impl<T> ErasedDestructor for T
where T: 'static,