Enum apollo_compiler::database::hir::Type
source · pub enum Type {
NonNull {
ty: Box<Type>,
loc: Option<HirNodeLocation>,
},
List {
ty: Box<Type>,
loc: Option<HirNodeLocation>,
},
Named {
name: String,
loc: Option<HirNodeLocation>,
},
}
Variants§
Implementations§
source§impl Type
impl Type
sourcepub fn is_non_null(&self) -> bool
pub fn is_non_null(&self) -> bool
Returns true
if the type is NonNull
.
sourcepub fn is_output_type(&self, db: &dyn HirDatabase) -> bool
pub fn is_output_type(&self, db: &dyn HirDatabase) -> bool
Returns true
if Type is either a ScalarTypeDefinition
,
ObjectTypeDefinition
, InterfaceTypeDefinition
,
UnionTypeDefinition
, EnumTypeDefinition
.
sourcepub fn is_input_type(&self, db: &dyn HirDatabase) -> bool
pub fn is_input_type(&self, db: &dyn HirDatabase) -> bool
Returns true
if the Type is either a ScalarTypeDefinition
,
EnumTypeDefinition
, InputObjectTypeDefinition
.
sourcepub fn loc(&self) -> Option<HirNodeLocation>
pub fn loc(&self) -> Option<HirNodeLocation>
Get the AST location information for this HIR node.
sourcepub fn type_def(&self, db: &dyn HirDatabase) -> Option<TypeDefinition>
pub fn type_def(&self, db: &dyn HirDatabase) -> Option<TypeDefinition>
Get current Type’s Type Definition.
Trait Implementations§
source§impl PartialEq<Type> for Type
impl PartialEq<Type> 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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.