Enum apollo_compiler::database::hir::TypeDefinition
source · pub enum TypeDefinition {
ScalarTypeDefinition(Arc<ScalarTypeDefinition>),
ObjectTypeDefinition(Arc<ObjectTypeDefinition>),
InterfaceTypeDefinition(Arc<InterfaceTypeDefinition>),
UnionTypeDefinition(Arc<UnionTypeDefinition>),
EnumTypeDefinition(Arc<EnumTypeDefinition>),
InputObjectTypeDefinition(Arc<InputObjectTypeDefinition>),
}
Variants§
ScalarTypeDefinition(Arc<ScalarTypeDefinition>)
ObjectTypeDefinition(Arc<ObjectTypeDefinition>)
InterfaceTypeDefinition(Arc<InterfaceTypeDefinition>)
UnionTypeDefinition(Arc<UnionTypeDefinition>)
EnumTypeDefinition(Arc<EnumTypeDefinition>)
InputObjectTypeDefinition(Arc<InputObjectTypeDefinition>)
Implementations§
source§impl TypeDefinition
impl TypeDefinition
pub fn name(&self) -> &str
pub fn name_src(&self) -> &Name
pub fn kind(&self) -> &'static str
sourcepub fn is_composite_definition(&self) -> bool
pub fn is_composite_definition(&self) -> bool
Returns whether this definition is a composite definition (union, interface, or object).
sourcepub fn is_output_definition(&self) -> bool
pub fn is_output_definition(&self) -> bool
Returns whether this definition is a scalar, object, interface, union, or enum.
sourcepub fn is_input_definition(&self) -> bool
pub fn is_input_definition(&self) -> bool
Returns whether this definition is an input object, scalar, or enum.
sourcepub fn self_directives(&self) -> &[Directive]
pub fn self_directives(&self) -> &[Directive]
Returns directives of this type definition (excluding those on its extensions)
sourcepub fn directives(&self) -> impl Iterator<Item = &Directive> + '_
pub fn directives(&self) -> impl Iterator<Item = &Directive> + '_
Returns an iterator of directives on either the type definition or its type extensions
sourcepub fn directive_by_name(&self, name: &str) -> Option<&Directive>
pub fn directive_by_name(&self, name: &str) -> Option<&Directive>
Returns the first directive with the given name.
For repeatable directives, see directives_by_name
(plural).
Includes directives on either the type definition or its type extensions,
like directives
.
sourcepub fn directives_by_name<'def: 'name, 'name>(
&'def self,
name: &'name str
) -> impl Iterator<Item = &'def Directive> + 'name
pub fn directives_by_name<'def: 'name, 'name>( &'def self, name: &'name str ) -> impl Iterator<Item = &'def Directive> + 'name
Returns an iterator of directives with the given name.
For non-repeatable directives, directive_by_name
(singular).
Includes directives on either the type definition or its type extensions,
like directives
.
pub fn field( &self, db: &dyn HirDatabase, name: &str ) -> Option<&FieldDefinition>
pub fn loc(&self) -> HirNodeLocation
sourcepub fn is_scalar_type_definition(&self) -> bool
pub fn is_scalar_type_definition(&self) -> bool
Returns true
if the type definition is ScalarTypeDefinition
.
sourcepub fn is_object_type_definition(&self) -> bool
pub fn is_object_type_definition(&self) -> bool
Returns true
if the type definition is ObjectTypeDefinition
.
sourcepub fn is_interface_type_definition(&self) -> bool
pub fn is_interface_type_definition(&self) -> bool
Returns true
if the type definition is InterfaceTypeDefinition
.
sourcepub fn is_union_type_definition(&self) -> bool
pub fn is_union_type_definition(&self) -> bool
Returns true
if the type definition is UnionTypeDefinition
.
sourcepub fn is_enum_type_definition(&self) -> bool
pub fn is_enum_type_definition(&self) -> bool
Returns true
if the type definition is EnumTypeDefinition
.
sourcepub fn is_input_object_type_definition(&self) -> bool
pub fn is_input_object_type_definition(&self) -> bool
Returns true
if the type definition is InputObjectTypeDefinition
.
Trait Implementations§
source§impl Clone for TypeDefinition
impl Clone for TypeDefinition
source§fn clone(&self) -> TypeDefinition
fn clone(&self) -> TypeDefinition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TypeDefinition
impl Debug for TypeDefinition
source§impl Hash for TypeDefinition
impl Hash for TypeDefinition
source§impl PartialEq<TypeDefinition> for TypeDefinition
impl PartialEq<TypeDefinition> for TypeDefinition
source§fn eq(&self, other: &TypeDefinition) -> bool
fn eq(&self, other: &TypeDefinition) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for TypeDefinition
impl StructuralEq for TypeDefinition
impl StructuralPartialEq for TypeDefinition
Auto Trait Implementations§
impl RefUnwindSafe for TypeDefinition
impl Send for TypeDefinition
impl Sync for TypeDefinition
impl Unpin for TypeDefinition
impl UnwindSafe for TypeDefinition
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
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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
key
and return true
if they are equal.