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

source

pub fn is_executable_definition(&self) -> bool

Returns true if this is an executable definition (operation or fragment).

source

pub fn is_extension_definition(&self) -> bool

Returns true if this is an extension of another definition.

source

pub fn location(&self) -> Option<NodeLocation>

source

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.

source

pub fn directives(&self) -> &Directives

source

pub fn serialize(&self) -> Serialize<'_, Self>

Returns a builder that has chaining methods for setting serialization configuration, and implements the Display and ToString traits by writing GraphQL syntax.

Trait Implementations§

source§

impl Clone for Definition

source§

fn clone(&self) -> Definition

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Definition

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Definition

Serialize to GraphQL syntax with the default configuration

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Node<DirectiveDefinition>> for Definition

source§

fn from(def: Node<DirectiveDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<EnumTypeDefinition>> for Definition

source§

fn from(def: Node<EnumTypeDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<EnumTypeExtension>> for Definition

source§

fn from(def: Node<EnumTypeExtension>) -> Self

Converts to this type from the input type.
source§

impl From<Node<FragmentDefinition>> for Definition

source§

fn from(def: Node<FragmentDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<InputObjectTypeDefinition>> for Definition

source§

fn from(def: Node<InputObjectTypeDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<InputObjectTypeExtension>> for Definition

source§

fn from(def: Node<InputObjectTypeExtension>) -> Self

Converts to this type from the input type.
source§

impl From<Node<InterfaceTypeDefinition>> for Definition

source§

fn from(def: Node<InterfaceTypeDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<InterfaceTypeExtension>> for Definition

source§

fn from(def: Node<InterfaceTypeExtension>) -> Self

Converts to this type from the input type.
source§

impl From<Node<ObjectTypeDefinition>> for Definition

source§

fn from(def: Node<ObjectTypeDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<ObjectTypeExtension>> for Definition

source§

fn from(def: Node<ObjectTypeExtension>) -> Self

Converts to this type from the input type.
source§

impl From<Node<OperationDefinition>> for Definition

source§

fn from(def: Node<OperationDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<ScalarTypeDefinition>> for Definition

source§

fn from(def: Node<ScalarTypeDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<ScalarTypeExtension>> for Definition

source§

fn from(def: Node<ScalarTypeExtension>) -> Self

Converts to this type from the input type.
source§

impl From<Node<SchemaDefinition>> for Definition

source§

fn from(def: Node<SchemaDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<SchemaExtension>> for Definition

source§

fn from(def: Node<SchemaExtension>) -> Self

Converts to this type from the input type.
source§

impl From<Node<UnionTypeDefinition>> for Definition

source§

fn from(def: Node<UnionTypeDefinition>) -> Self

Converts to this type from the input type.
source§

impl From<Node<UnionTypeExtension>> for Definition

source§

fn from(def: Node<UnionTypeExtension>) -> Self

Converts to this type from the input type.
source§

impl Hash for Definition

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Definition

source§

fn eq(&self, other: &Definition) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Definition

source§

impl StructuralEq for Definition

source§

impl StructuralPartialEq for Definition

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> Fmt for T
where T: Display,

source§

fn fg<C>(self, color: C) -> Foreground<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified foreground colour.
source§

fn bg<C>(self, color: C) -> Background<Self>
where C: Into<Option<Color>>, Self: Display,

Give this value the specified background colour.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StdoutFmt for T
where T: Display,

source§

fn fg<C>(self, color: C) -> Foreground<Self>
where C: Into<Option<Color>>,

Give this value the specified foreground colour, when color is enabled for stdout.
source§

fn bg<C>(self, color: C) -> Background<Self>
where C: Into<Option<Color>>,

Give this value the specified background colour, when color is enabled for stdout.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.