Enum apollo_compiler::ast::Definition
source · pub enum Definition {
Show 17 variants
OperationDefinition(Node<OperationDefinition>),
FragmentDefinition(Node<FragmentDefinition>),
DirectiveDefinition(Node<DirectiveDefinition>),
SchemaDefinition(Node<SchemaDefinition>),
ScalarTypeDefinition(Node<ScalarTypeDefinition>),
ObjectTypeDefinition(Node<ObjectTypeDefinition>),
InterfaceTypeDefinition(Node<InterfaceTypeDefinition>),
UnionTypeDefinition(Node<UnionTypeDefinition>),
EnumTypeDefinition(Node<EnumTypeDefinition>),
InputObjectTypeDefinition(Node<InputObjectTypeDefinition>),
SchemaExtension(Node<SchemaExtension>),
ScalarTypeExtension(Node<ScalarTypeExtension>),
ObjectTypeExtension(Node<ObjectTypeExtension>),
InterfaceTypeExtension(Node<InterfaceTypeExtension>),
UnionTypeExtension(Node<UnionTypeExtension>),
EnumTypeExtension(Node<EnumTypeExtension>),
InputObjectTypeExtension(Node<InputObjectTypeExtension>),
}
Variants§
OperationDefinition(Node<OperationDefinition>)
FragmentDefinition(Node<FragmentDefinition>)
DirectiveDefinition(Node<DirectiveDefinition>)
SchemaDefinition(Node<SchemaDefinition>)
ScalarTypeDefinition(Node<ScalarTypeDefinition>)
ObjectTypeDefinition(Node<ObjectTypeDefinition>)
InterfaceTypeDefinition(Node<InterfaceTypeDefinition>)
UnionTypeDefinition(Node<UnionTypeDefinition>)
EnumTypeDefinition(Node<EnumTypeDefinition>)
InputObjectTypeDefinition(Node<InputObjectTypeDefinition>)
SchemaExtension(Node<SchemaExtension>)
ScalarTypeExtension(Node<ScalarTypeExtension>)
ObjectTypeExtension(Node<ObjectTypeExtension>)
InterfaceTypeExtension(Node<InterfaceTypeExtension>)
UnionTypeExtension(Node<UnionTypeExtension>)
EnumTypeExtension(Node<EnumTypeExtension>)
InputObjectTypeExtension(Node<InputObjectTypeExtension>)
Implementations§
source§impl Definition
impl Definition
sourcepub fn is_executable_definition(&self) -> bool
pub fn is_executable_definition(&self) -> bool
Returns true if this is an executable definition (operation or fragment).
sourcepub fn is_extension_definition(&self) -> bool
pub fn is_extension_definition(&self) -> bool
Returns true if this is an extension of another definition.
pub fn location(&self) -> Option<NodeLocation>
sourcepub fn name(&self) -> Option<&Name>
pub fn name(&self) -> Option<&Name>
Return the name of this type definition or extension.
Operations may be anonymous, and schema definitions never have a name, in that case this function returns None
.
pub fn directives(&self) -> &Directives
Trait Implementations§
source§impl Clone for Definition
impl Clone for Definition
source§fn clone(&self) -> Definition
fn clone(&self) -> Definition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Definition
impl Debug for Definition
source§impl Display for Definition
impl Display for Definition
Serialize to GraphQL syntax with the default configuration
source§impl From<Node<DirectiveDefinition>> for Definition
impl From<Node<DirectiveDefinition>> for Definition
source§fn from(def: Node<DirectiveDefinition>) -> Self
fn from(def: Node<DirectiveDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<EnumTypeDefinition>> for Definition
impl From<Node<EnumTypeDefinition>> for Definition
source§fn from(def: Node<EnumTypeDefinition>) -> Self
fn from(def: Node<EnumTypeDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<EnumTypeExtension>> for Definition
impl From<Node<EnumTypeExtension>> for Definition
source§fn from(def: Node<EnumTypeExtension>) -> Self
fn from(def: Node<EnumTypeExtension>) -> Self
Converts to this type from the input type.
source§impl From<Node<FragmentDefinition>> for Definition
impl From<Node<FragmentDefinition>> for Definition
source§fn from(def: Node<FragmentDefinition>) -> Self
fn from(def: Node<FragmentDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<InputObjectTypeDefinition>> for Definition
impl From<Node<InputObjectTypeDefinition>> for Definition
source§fn from(def: Node<InputObjectTypeDefinition>) -> Self
fn from(def: Node<InputObjectTypeDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<InputObjectTypeExtension>> for Definition
impl From<Node<InputObjectTypeExtension>> for Definition
source§fn from(def: Node<InputObjectTypeExtension>) -> Self
fn from(def: Node<InputObjectTypeExtension>) -> Self
Converts to this type from the input type.
source§impl From<Node<InterfaceTypeDefinition>> for Definition
impl From<Node<InterfaceTypeDefinition>> for Definition
source§fn from(def: Node<InterfaceTypeDefinition>) -> Self
fn from(def: Node<InterfaceTypeDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<InterfaceTypeExtension>> for Definition
impl From<Node<InterfaceTypeExtension>> for Definition
source§fn from(def: Node<InterfaceTypeExtension>) -> Self
fn from(def: Node<InterfaceTypeExtension>) -> Self
Converts to this type from the input type.
source§impl From<Node<ObjectTypeDefinition>> for Definition
impl From<Node<ObjectTypeDefinition>> for Definition
source§fn from(def: Node<ObjectTypeDefinition>) -> Self
fn from(def: Node<ObjectTypeDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<ObjectTypeExtension>> for Definition
impl From<Node<ObjectTypeExtension>> for Definition
source§fn from(def: Node<ObjectTypeExtension>) -> Self
fn from(def: Node<ObjectTypeExtension>) -> Self
Converts to this type from the input type.
source§impl From<Node<OperationDefinition>> for Definition
impl From<Node<OperationDefinition>> for Definition
source§fn from(def: Node<OperationDefinition>) -> Self
fn from(def: Node<OperationDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<ScalarTypeDefinition>> for Definition
impl From<Node<ScalarTypeDefinition>> for Definition
source§fn from(def: Node<ScalarTypeDefinition>) -> Self
fn from(def: Node<ScalarTypeDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<ScalarTypeExtension>> for Definition
impl From<Node<ScalarTypeExtension>> for Definition
source§fn from(def: Node<ScalarTypeExtension>) -> Self
fn from(def: Node<ScalarTypeExtension>) -> Self
Converts to this type from the input type.
source§impl From<Node<SchemaDefinition>> for Definition
impl From<Node<SchemaDefinition>> for Definition
source§fn from(def: Node<SchemaDefinition>) -> Self
fn from(def: Node<SchemaDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<SchemaExtension>> for Definition
impl From<Node<SchemaExtension>> for Definition
source§fn from(def: Node<SchemaExtension>) -> Self
fn from(def: Node<SchemaExtension>) -> Self
Converts to this type from the input type.
source§impl From<Node<UnionTypeDefinition>> for Definition
impl From<Node<UnionTypeDefinition>> for Definition
source§fn from(def: Node<UnionTypeDefinition>) -> Self
fn from(def: Node<UnionTypeDefinition>) -> Self
Converts to this type from the input type.
source§impl From<Node<UnionTypeExtension>> for Definition
impl From<Node<UnionTypeExtension>> for Definition
source§fn from(def: Node<UnionTypeExtension>) -> Self
fn from(def: Node<UnionTypeExtension>) -> Self
Converts to this type from the input type.
source§impl Hash for Definition
impl Hash for Definition
source§impl PartialEq for Definition
impl PartialEq for Definition
source§fn eq(&self, other: &Definition) -> bool
fn eq(&self, other: &Definition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for Definition
impl StructuralEq for Definition
impl StructuralPartialEq for Definition
Auto Trait Implementations§
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnwindSafe for Definition
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
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.