Struct apollo_compiler::database::hir::EnumTypeDefinition
source · pub struct EnumTypeDefinition { /* private fields */ }
Implementations§
source§impl EnumTypeDefinition
impl EnumTypeDefinition
sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Get a reference to the enum definition’s description.
sourcepub fn self_directives(&self) -> &[Directive]
pub fn self_directives(&self) -> &[Directive]
Get a reference to enum 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_values(&self) -> &[EnumValueDefinition]
pub fn self_values(&self) -> &[EnumValueDefinition]
Returns the values of this enum definition, excluding those from extensions.
sourcepub fn values(
&self
) -> impl Iterator<Item = &EnumValueDefinition> + ExactSizeIterator + DoubleEndedIterator
pub fn values( &self ) -> impl Iterator<Item = &EnumValueDefinition> + ExactSizeIterator + DoubleEndedIterator
Returns an iterator of values of this enum type, whether from its own definition or from extensions.
sourcepub fn value(&self, name: &str) -> Option<&EnumValueDefinition>
pub fn value(&self, name: &str) -> Option<&EnumValueDefinition>
Find an enum value by its name, either in this enum type 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<EnumTypeExtension>]
pub fn extensions(&self) -> &[Arc<EnumTypeExtension>]
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:
__TypeKind
, __DirectiveLocation
Trait Implementations§
source§impl Clone for EnumTypeDefinition
impl Clone for EnumTypeDefinition
source§fn clone(&self) -> EnumTypeDefinition
fn clone(&self) -> EnumTypeDefinition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EnumTypeDefinition
impl Debug for EnumTypeDefinition
source§impl Hash for EnumTypeDefinition
impl Hash for EnumTypeDefinition
source§impl PartialEq<EnumTypeDefinition> for EnumTypeDefinition
impl PartialEq<EnumTypeDefinition> for EnumTypeDefinition
source§fn eq(&self, other: &EnumTypeDefinition) -> bool
fn eq(&self, other: &EnumTypeDefinition) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for EnumTypeDefinition
impl StructuralEq for EnumTypeDefinition
impl StructuralPartialEq for EnumTypeDefinition
Auto Trait Implementations§
impl RefUnwindSafe for EnumTypeDefinition
impl Send for EnumTypeDefinition
impl Sync for EnumTypeDefinition
impl Unpin for EnumTypeDefinition
impl UnwindSafe for EnumTypeDefinition
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.