Enum apollo_compiler::ast::Type
source · pub enum Type {
Named(NamedType),
NonNullNamed(NamedType),
List(Box<Type>),
NonNullList(Box<Type>),
}
Variants§
Implementations§
source§impl Type
impl Type
sourcepub fn new_named(name: &str) -> Self
pub fn new_named(name: &str) -> Self
Returns a new Type::Named
with with a synthetic Name
(not parsed from a source file)
sourcepub fn inner_named_type(&self) -> &NamedType
pub fn inner_named_type(&self) -> &NamedType
Returns the inner named type, after unwrapping any non-null or list markers.
sourcepub fn is_non_null(&self) -> bool
pub fn is_non_null(&self) -> bool
Returns whether this type is non-null
pub fn is_named(&self) -> bool
sourcepub fn is_assignable_to(&self, target: &Self) -> bool
pub fn is_assignable_to(&self, target: &Self) -> bool
Can a value of this type be used when the target
type is expected?
Implementation of spec function AreTypesCompatible()
.
Trait Implementations§
source§impl PartialEq for Type
impl PartialEq for Type
impl Eq for Type
impl StructuralEq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.