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