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
impl TypeDef
Sourcepub fn as_enum(&self) -> EnumTypeDef
pub fn as_enum(&self) -> EnumTypeDef
If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null.
Sourcepub fn as_input(&self) -> InputTypeDef
pub fn as_input(&self) -> InputTypeDef
If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
Sourcepub fn as_interface(&self) -> InterfaceTypeDef
pub fn as_interface(&self) -> InterfaceTypeDef
If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
Sourcepub fn as_list(&self) -> ListTypeDef
pub fn as_list(&self) -> ListTypeDef
If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
Sourcepub fn as_object(&self) -> ObjectTypeDef
pub fn as_object(&self) -> ObjectTypeDef
If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
Sourcepub fn as_scalar(&self) -> ScalarTypeDef
pub fn as_scalar(&self) -> ScalarTypeDef
If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null.
Sourcepub async fn id(&self) -> Result<TypeDefId, DaggerError>
pub async fn id(&self) -> Result<TypeDefId, DaggerError>
A unique identifier for this TypeDef.
Sourcepub async fn kind(&self) -> Result<TypeDefKind, DaggerError>
pub async fn kind(&self) -> Result<TypeDefKind, DaggerError>
The kind of type this is (e.g. primitive, list, object).
Sourcepub async fn optional(&self) -> Result<bool, DaggerError>
pub async fn optional(&self) -> Result<bool, DaggerError>
Whether this type can be set to null. Defaults to false.
Sourcepub fn with_constructor(&self, function: impl IntoID<FunctionId>) -> TypeDef
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.
Sourcepub fn with_enum(&self, name: impl Into<String>) -> TypeDef
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 enumopt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_enum_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithEnumOpts<'a>,
) -> TypeDef
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 enumopt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef
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 enumopt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_enum_member_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithEnumMemberOpts<'a>,
) -> TypeDef
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 enumopt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef
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 enumopt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_enum_value_opts<'a>(
&self,
value: impl Into<String>,
opts: TypeDefWithEnumValueOpts<'a>,
) -> TypeDef
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 enumopt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_field(
&self,
name: impl Into<String>,
type_def: impl IntoID<TypeDefId>,
) -> TypeDef
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 objecttype_def
- The type of the fieldopt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_field_opts<'a>(
&self,
name: impl Into<String>,
type_def: impl IntoID<TypeDefId>,
opts: TypeDefWithFieldOpts<'a>,
) -> TypeDef
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 objecttype_def
- The type of the fieldopt
- optional argument, see inner type for documentation, use_opts to use
Sourcepub fn with_function(&self, function: impl IntoID<FunctionId>) -> TypeDef
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.
Sourcepub fn with_interface(&self, name: impl Into<String>) -> TypeDef
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
Sourcepub fn with_interface_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithInterfaceOpts<'a>,
) -> TypeDef
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
Sourcepub fn with_kind(&self, kind: TypeDefKind) -> TypeDef
pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef
Sets the kind of the type.
Sourcepub fn with_list_of(&self, element_type: impl IntoID<TypeDefId>) -> TypeDef
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.
Sourcepub fn with_object(&self, name: impl Into<String>) -> TypeDef
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
Sourcepub fn with_object_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithObjectOpts<'a>,
) -> TypeDef
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
Sourcepub fn with_optional(&self, optional: bool) -> TypeDef
pub fn with_optional(&self, optional: bool) -> TypeDef
Sets whether this type can be set to null.
Sourcepub fn with_scalar(&self, name: impl Into<String>) -> TypeDef
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
Sourcepub fn with_scalar_opts<'a>(
&self,
name: impl Into<String>,
opts: TypeDefWithScalarOpts<'a>,
) -> TypeDef
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