Enum juniper::Type
[−]
[src]
pub enum Type { Named(String), List(Box<Type>), NonNullNamed(String), NonNullList(Box<Type>), }
A type literal in the syntax tree
This enum carries no semantic information and might refer to types that do not exist.
Variants
Named(String)
A nullable named type, e.g. String
List(Box<Type>)
A nullable list type, e.g. [String]
The list itself is what's nullable, the containing type might be non-null.
NonNullNamed(String)
A non-null named type, e.g. String!
NonNullList(Box<Type>)
A non-null list type, e.g. [String]!
.
The list itself is what's non-null, the containing type might be null.
Methods
impl Type
[src]
fn name(&self) -> Option<&str>
Get the name of a named type.
Only applies to named types; lists will return None
.
fn innermost_name(&self) -> &str
Get the innermost name by unpacking lists
All type literals contain exactly one named type.
fn is_non_null(&self) -> bool
Determines if a type only can represent non-null values.
Trait Implementations
impl Clone for Type
[src]
fn clone(&self) -> Type
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Eq for Type
[src]
impl PartialEq for Type
[src]
fn eq(&self, __arg_0: &Type) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Type) -> bool
This method tests for !=
.