pub enum Type<'a> {
NamedType(NamedType<'a>),
ListType(&'a Type<'a>),
NonNullType(&'a Type<'a>),
}
Expand description
AST Node for a type reference.
VariableDefinitions
must describe their type when they’re defined, including whether they expect
lists, non-null values, or a type reference, which is a recursive type definition.
Reference
Variants§
NamedType(NamedType<'a>)
A reference to a named input type, which is a leaf node of a Type.
ListType(&'a Type<'a>)
A list node wrapper for a Type, which indicates that a GraphQL API will always pass a list of the contained type in place.
NonNullType(&'a Type<'a>)
A non-null node wrapper for a Type, which indicates that a GraphQL API may not pass null
instead
of the conained type.
Implementations§
Source§impl<'a> Type<'a>
impl<'a> Type<'a>
Sourcepub fn into_list(self, ctx: &'a ASTContext) -> Type<'a>
pub fn into_list(self, ctx: &'a ASTContext) -> Type<'a>
Wraps this type in a list, indicating that it expects the current Type to be a list of itself instead.
Sourcepub fn into_nonnull(self, ctx: &'a ASTContext) -> Type<'a>
pub fn into_nonnull(self, ctx: &'a ASTContext) -> Type<'a>
A non-null node wrapper for a Type, indicating that a GraphQL API may not pass null
instead
of the conained type.
Trait Implementations§
impl<'a> Copy for Type<'a>
impl<'a> Eq for Type<'a>
impl<'a> StructuralPartialEq for Type<'a>
Auto Trait Implementations§
impl<'a> Freeze for Type<'a>
impl<'a> RefUnwindSafe for Type<'a>
impl<'a> Send for Type<'a>
impl<'a> Sync for Type<'a>
impl<'a> Unpin for Type<'a>
impl<'a> UnwindSafe for Type<'a>
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