pub enum TypeDefinition<'a, S: SchemaDefinition, W: Warden<SchemaDefinition = S>> {
BuiltinScalar(BuiltinScalarDefinition),
CustomScalar(ScalarTypeDefinition<'a, S, W>),
Object(ObjectTypeDefinition<'a, S, W>),
Interface(InterfaceTypeDefinition<'a, S, W>),
InputObject(InputObjectTypeDefinition<'a, S, W>),
Enum(EnumTypeDefinition<'a, S, W>),
Union(UnionTypeDefinition<'a, S, W>),
}Variants§
BuiltinScalar(BuiltinScalarDefinition)
CustomScalar(ScalarTypeDefinition<'a, S, W>)
Object(ObjectTypeDefinition<'a, S, W>)
Interface(InterfaceTypeDefinition<'a, S, W>)
InputObject(InputObjectTypeDefinition<'a, S, W>)
Enum(EnumTypeDefinition<'a, S, W>)
Union(UnionTypeDefinition<'a, S, W>)
Implementations§
Source§impl<'a, S: SchemaDefinition, W: Warden<SchemaDefinition = S>> TypeDefinition<'a, S, W>
impl<'a, S: SchemaDefinition, W: Warden<SchemaDefinition = S>> TypeDefinition<'a, S, W>
Sourcepub fn is_builtin_scalar(&self) -> bool
pub fn is_builtin_scalar(&self) -> bool
Returns true if this is a TypeDefinition::BuiltinScalar, otherwise false
Sourcepub fn as_builtin_scalar_mut(&mut self) -> Option<&mut BuiltinScalarDefinition>
pub fn as_builtin_scalar_mut(&mut self) -> Option<&mut BuiltinScalarDefinition>
Optionally returns mutable references to the inner fields if this is a TypeDefinition::BuiltinScalar, otherwise None
Sourcepub fn as_builtin_scalar(&self) -> Option<&BuiltinScalarDefinition>
pub fn as_builtin_scalar(&self) -> Option<&BuiltinScalarDefinition>
Optionally returns references to the inner fields if this is a TypeDefinition::BuiltinScalar, otherwise None
Sourcepub fn into_builtin_scalar(self) -> Result<BuiltinScalarDefinition, Self>
pub fn into_builtin_scalar(self) -> Result<BuiltinScalarDefinition, Self>
Returns the inner fields if this is a TypeDefinition::BuiltinScalar, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_custom_scalar(&self) -> bool
pub fn is_custom_scalar(&self) -> bool
Returns true if this is a TypeDefinition::CustomScalar, otherwise false
Sourcepub fn as_custom_scalar_mut(
&mut self,
) -> Option<&mut ScalarTypeDefinition<'a, S, W>>
pub fn as_custom_scalar_mut( &mut self, ) -> Option<&mut ScalarTypeDefinition<'a, S, W>>
Optionally returns mutable references to the inner fields if this is a TypeDefinition::CustomScalar, otherwise None
Sourcepub fn as_custom_scalar(&self) -> Option<&ScalarTypeDefinition<'a, S, W>>
pub fn as_custom_scalar(&self) -> Option<&ScalarTypeDefinition<'a, S, W>>
Optionally returns references to the inner fields if this is a TypeDefinition::CustomScalar, otherwise None
Sourcepub fn into_custom_scalar(self) -> Result<ScalarTypeDefinition<'a, S, W>, Self>
pub fn into_custom_scalar(self) -> Result<ScalarTypeDefinition<'a, S, W>, Self>
Returns the inner fields if this is a TypeDefinition::CustomScalar, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_object(&self) -> bool
pub fn is_object(&self) -> bool
Returns true if this is a TypeDefinition::Object, otherwise false
Sourcepub fn as_object_mut(&mut self) -> Option<&mut ObjectTypeDefinition<'a, S, W>>
pub fn as_object_mut(&mut self) -> Option<&mut ObjectTypeDefinition<'a, S, W>>
Optionally returns mutable references to the inner fields if this is a TypeDefinition::Object, otherwise None
Sourcepub fn as_object(&self) -> Option<&ObjectTypeDefinition<'a, S, W>>
pub fn as_object(&self) -> Option<&ObjectTypeDefinition<'a, S, W>>
Optionally returns references to the inner fields if this is a TypeDefinition::Object, otherwise None
Sourcepub fn into_object(self) -> Result<ObjectTypeDefinition<'a, S, W>, Self>
pub fn into_object(self) -> Result<ObjectTypeDefinition<'a, S, W>, Self>
Returns the inner fields if this is a TypeDefinition::Object, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_interface(&self) -> bool
pub fn is_interface(&self) -> bool
Returns true if this is a TypeDefinition::Interface, otherwise false
Sourcepub fn as_interface_mut(
&mut self,
) -> Option<&mut InterfaceTypeDefinition<'a, S, W>>
pub fn as_interface_mut( &mut self, ) -> Option<&mut InterfaceTypeDefinition<'a, S, W>>
Optionally returns mutable references to the inner fields if this is a TypeDefinition::Interface, otherwise None
Sourcepub fn as_interface(&self) -> Option<&InterfaceTypeDefinition<'a, S, W>>
pub fn as_interface(&self) -> Option<&InterfaceTypeDefinition<'a, S, W>>
Optionally returns references to the inner fields if this is a TypeDefinition::Interface, otherwise None
Sourcepub fn into_interface(self) -> Result<InterfaceTypeDefinition<'a, S, W>, Self>
pub fn into_interface(self) -> Result<InterfaceTypeDefinition<'a, S, W>, Self>
Returns the inner fields if this is a TypeDefinition::Interface, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_input_object(&self) -> bool
pub fn is_input_object(&self) -> bool
Returns true if this is a TypeDefinition::InputObject, otherwise false
Sourcepub fn as_input_object_mut(
&mut self,
) -> Option<&mut InputObjectTypeDefinition<'a, S, W>>
pub fn as_input_object_mut( &mut self, ) -> Option<&mut InputObjectTypeDefinition<'a, S, W>>
Optionally returns mutable references to the inner fields if this is a TypeDefinition::InputObject, otherwise None
Sourcepub fn as_input_object(&self) -> Option<&InputObjectTypeDefinition<'a, S, W>>
pub fn as_input_object(&self) -> Option<&InputObjectTypeDefinition<'a, S, W>>
Optionally returns references to the inner fields if this is a TypeDefinition::InputObject, otherwise None
Sourcepub fn into_input_object(
self,
) -> Result<InputObjectTypeDefinition<'a, S, W>, Self>
pub fn into_input_object( self, ) -> Result<InputObjectTypeDefinition<'a, S, W>, Self>
Returns the inner fields if this is a TypeDefinition::InputObject, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_enum_mut(&mut self) -> Option<&mut EnumTypeDefinition<'a, S, W>>
pub fn as_enum_mut(&mut self) -> Option<&mut EnumTypeDefinition<'a, S, W>>
Optionally returns mutable references to the inner fields if this is a TypeDefinition::Enum, otherwise None
Sourcepub fn as_enum(&self) -> Option<&EnumTypeDefinition<'a, S, W>>
pub fn as_enum(&self) -> Option<&EnumTypeDefinition<'a, S, W>>
Optionally returns references to the inner fields if this is a TypeDefinition::Enum, otherwise None
Sourcepub fn into_enum(self) -> Result<EnumTypeDefinition<'a, S, W>, Self>
pub fn into_enum(self) -> Result<EnumTypeDefinition<'a, S, W>, Self>
Returns the inner fields if this is a TypeDefinition::Enum, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_union(&self) -> bool
pub fn is_union(&self) -> bool
Returns true if this is a TypeDefinition::Union, otherwise false
Sourcepub fn as_union_mut(&mut self) -> Option<&mut UnionTypeDefinition<'a, S, W>>
pub fn as_union_mut(&mut self) -> Option<&mut UnionTypeDefinition<'a, S, W>>
Optionally returns mutable references to the inner fields if this is a TypeDefinition::Union, otherwise None
Sourcepub fn as_union(&self) -> Option<&UnionTypeDefinition<'a, S, W>>
pub fn as_union(&self) -> Option<&UnionTypeDefinition<'a, S, W>>
Optionally returns references to the inner fields if this is a TypeDefinition::Union, otherwise None
Sourcepub fn into_union(self) -> Result<UnionTypeDefinition<'a, S, W>, Self>
pub fn into_union(self) -> Result<UnionTypeDefinition<'a, S, W>, Self>
Returns the inner fields if this is a TypeDefinition::Union, otherwise returns back the enum in the Err case of the result
Trait Implementations§
Source§impl<'a, S: SchemaDefinition + 'a, W: Warden<SchemaDefinition = S>> TypeDefinition for TypeDefinition<'a, S, W>
impl<'a, S: SchemaDefinition + 'a, W: Warden<SchemaDefinition = S>> TypeDefinition for TypeDefinition<'a, S, W>
type ObjectTypeDefinition = ObjectTypeDefinition<'a, S, W>
type InputObjectTypeDefinition = InputObjectTypeDefinition<'a, S, W>
type CustomScalarTypeDefinition = ScalarTypeDefinition<'a, S, W>
type InterfaceTypeDefinition = InterfaceTypeDefinition<'a, S, W>
type EnumTypeDefinition = EnumTypeDefinition<'a, S, W>
type UnionTypeDefinition = UnionTypeDefinition<'a, S, W>
fn as_ref(&self) -> TypeDefinitionReference<'_, Self>
Auto Trait Implementations§
impl<'a, S, W> !Freeze for TypeDefinition<'a, S, W>
impl<'a, S, W> !RefUnwindSafe for TypeDefinition<'a, S, W>
impl<'a, S, W> !Send for TypeDefinition<'a, S, W>
impl<'a, S, W> !Sync for TypeDefinition<'a, S, W>
impl<'a, S, W> Unpin for TypeDefinition<'a, S, W>where
W: Unpin,
impl<'a, S, W> !UnwindSafe for TypeDefinition<'a, S, W>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more