Struct apollo_compiler::database::hir::ScalarTypeDefinition
source · pub struct ScalarTypeDefinition { /* private fields */ }
Implementations§
source§impl ScalarTypeDefinition
impl ScalarTypeDefinition
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Get the scalar type definition’s id. Get a reference to the scalar definition’s name.
sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Get a reference to the scalar definition’s description.
sourcepub fn self_directives(&self) -> &[Directive]
pub fn self_directives(&self) -> &[Directive]
Get a reference to scalar 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 loc(&self) -> HirNodeLocation
pub fn loc(&self) -> HirNodeLocation
Get the AST location information for this HIR node.
sourcepub fn extensions(&self) -> &[Arc<ScalarTypeExtension>]
pub fn extensions(&self) -> &[Arc<ScalarTypeExtension>]
Extensions that apply to this definition
sourcepub fn is_built_in(&self) -> bool
pub fn is_built_in(&self) -> bool
Returns true if the current scalar is a GraphQL built in.
sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Returns true if the current scalar is the built in Boolean type.
Trait Implementations§
source§impl Clone for ScalarTypeDefinition
impl Clone for ScalarTypeDefinition
source§fn clone(&self) -> ScalarTypeDefinition
fn clone(&self) -> ScalarTypeDefinition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScalarTypeDefinition
impl Debug for ScalarTypeDefinition
source§impl Hash for ScalarTypeDefinition
impl Hash for ScalarTypeDefinition
source§impl PartialEq<ScalarTypeDefinition> for ScalarTypeDefinition
impl PartialEq<ScalarTypeDefinition> for ScalarTypeDefinition
source§fn eq(&self, other: &ScalarTypeDefinition) -> bool
fn eq(&self, other: &ScalarTypeDefinition) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for ScalarTypeDefinition
impl StructuralEq for ScalarTypeDefinition
impl StructuralPartialEq for ScalarTypeDefinition
Auto Trait Implementations§
impl RefUnwindSafe for ScalarTypeDefinition
impl Send for ScalarTypeDefinition
impl Sync for ScalarTypeDefinition
impl Unpin for ScalarTypeDefinition
impl UnwindSafe for ScalarTypeDefinition
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.