Enum juniper::Type
[−]
[src]
pub enum Type<'a> { Named(&'a str), List(Box<Type<'a>>), NonNullNamed(&'a str), NonNullList(Box<Type<'a>>), }
A type literal in the syntax tree
This enum carries no semantic information and might refer to types that do not exist.
Variants
Named(&'a str)
A nullable named type, e.g. String
List(Box<Type<'a>>)
A nullable list type, e.g. [String]
The list itself is what's nullable, the containing type might be non-null.
NonNullNamed(&'a str)
A non-null named type, e.g. String!
NonNullList(Box<Type<'a>>)
A non-null list type, e.g. [String]!
.
The list itself is what's non-null, the containing type might be null.
Methods
impl<'a> Type<'a>
[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<'a> Clone for Type<'a>
[src]
fn clone(&self) -> Type<'a>
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<'a> Eq for Type<'a>
[src]
impl<'a> PartialEq for Type<'a>
[src]
fn eq(&self, __arg_0: &Type<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Type<'a>) -> bool
This method tests for !=
.