Struct apollo_compiler::database::hir::ObjectTypeDefinition
source · pub struct ObjectTypeDefinition { /* private fields */ }
Implementations§
source§impl ObjectTypeDefinition
impl ObjectTypeDefinition
sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Get a reference to the object type definition’s description.
sourcepub fn self_directives(&self) -> &[Directive]
pub fn self_directives(&self) -> &[Directive]
Get a reference to the object type definition’s directives (excluding those on 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 schema
definition or its 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 schema
definition or its extensions,
like directives
.
sourcepub fn self_fields(&self) -> &[FieldDefinition]
pub fn self_fields(&self) -> &[FieldDefinition]
Get a reference to the object type definition’s field definitions, excluding fields from extensions.
sourcepub fn fields(
&self
) -> impl Iterator<Item = &FieldDefinition> + ExactSizeIterator + DoubleEndedIterator
pub fn fields( &self ) -> impl Iterator<Item = &FieldDefinition> + ExactSizeIterator + DoubleEndedIterator
Returns an iterator of fields of this object type, whether from its own definition or from extensions.
sourcepub fn field(
&self,
db: &dyn HirDatabase,
name: &str
) -> Option<&FieldDefinition>
pub fn field( &self, db: &dyn HirDatabase, name: &str ) -> Option<&FieldDefinition>
Find a field by its name, either in this object type definition or its extensions.
sourcepub fn self_implements_interfaces(&self) -> &[ImplementsInterface]
pub fn self_implements_interfaces(&self) -> &[ImplementsInterface]
Returns interfaces implemented by this object type definition, excluding those from extensions.
sourcepub fn implements_interfaces(
&self
) -> impl Iterator<Item = &ImplementsInterface> + ExactSizeIterator + DoubleEndedIterator
pub fn implements_interfaces( &self ) -> impl Iterator<Item = &ImplementsInterface> + ExactSizeIterator + DoubleEndedIterator
Returns an iterator of interfaces implemented by this object type, whether from its own definition or from extensions.
sourcepub fn implements_interface(&self, name: &str) -> bool
pub fn implements_interface(&self, name: &str) -> bool
Returns whether this object type implements the interface of the given name, either in its own definition or its extensions.
sourcepub fn loc(&self) -> HirNodeLocation
pub fn loc(&self) -> HirNodeLocation
Get the AST location information for this HIR node.
sourcepub fn extensions(&self) -> &[Arc<ObjectTypeExtension>]
pub fn extensions(&self) -> &[Arc<ObjectTypeExtension>]
Extensions that apply to this definition
sourcepub fn is_introspection(&self) -> bool
pub fn is_introspection(&self) -> bool
Returns true
if this Object Type Definition is one of the
introspection types:
__Schema
, __Type
, __Field
, __InputValue
,
__EnumValue
, __Directive
Trait Implementations§
source§impl Clone for ObjectTypeDefinition
impl Clone for ObjectTypeDefinition
source§fn clone(&self) -> ObjectTypeDefinition
fn clone(&self) -> ObjectTypeDefinition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ObjectTypeDefinition
impl Debug for ObjectTypeDefinition
source§impl Hash for ObjectTypeDefinition
impl Hash for ObjectTypeDefinition
source§impl PartialEq<ObjectTypeDefinition> for ObjectTypeDefinition
impl PartialEq<ObjectTypeDefinition> for ObjectTypeDefinition
source§fn eq(&self, other: &ObjectTypeDefinition) -> bool
fn eq(&self, other: &ObjectTypeDefinition) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for ObjectTypeDefinition
impl StructuralEq for ObjectTypeDefinition
impl StructuralPartialEq for ObjectTypeDefinition
Auto Trait Implementations§
impl RefUnwindSafe for ObjectTypeDefinition
impl Send for ObjectTypeDefinition
impl Sync for ObjectTypeDefinition
impl Unpin for ObjectTypeDefinition
impl UnwindSafe for ObjectTypeDefinition
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
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.