pub enum ExtendedType {
    Scalar(Node<ScalarType>),
    Object(Node<ObjectType>),
    Interface(Node<InterfaceType>),
    Union(Node<UnionType>),
    Enum(Node<EnumType>),
    InputObject(Node<InputObjectType>),
}
Expand description

The definition of a named type, with all information from type extensions folded in.

The source location is that of the “main” definition.

Variants§

Implementations§

source§

impl ExtendedType

source

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

Return the source location of the type’s base definition.

If the type has extensions, those are not covered by this location.

source

pub fn is_scalar(&self) -> bool

source

pub fn is_object(&self) -> bool

source

pub fn is_interface(&self) -> bool

source

pub fn is_union(&self) -> bool

source

pub fn is_enum(&self) -> bool

source

pub fn is_input_object(&self) -> bool

source

pub fn is_input_type(&self) -> bool

Returns true if a value of this type can be used as an input value.

Spec

This implements spec function IsInputType(type)

source

pub fn is_output_type(&self) -> bool

Returns true if a value of this type can be used as an output value.

Spec

This implements spec function IsOutputType(type)

source

pub fn is_built_in(&self) -> bool

Returns whether this is a built-in scalar or introspection type

source

pub fn directives(&self) -> &Directives

source

pub fn description(&self) -> Option<&NodeStr>

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 ExtendedType

source§

fn clone(&self) -> ExtendedType

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 ExtendedType

source§

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

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

impl From<EnumType> for ExtendedType

source§

fn from(ty: EnumType) -> Self

Converts to this type from the input type.
source§

impl From<InputObjectType> for ExtendedType

source§

fn from(ty: InputObjectType) -> Self

Converts to this type from the input type.
source§

impl From<InterfaceType> for ExtendedType

source§

fn from(ty: InterfaceType) -> Self

Converts to this type from the input type.
source§

impl From<Node<EnumType>> for ExtendedType

source§

fn from(ty: Node<EnumType>) -> Self

Converts to this type from the input type.
source§

impl From<Node<InputObjectType>> for ExtendedType

source§

fn from(ty: Node<InputObjectType>) -> Self

Converts to this type from the input type.
source§

impl From<Node<InterfaceType>> for ExtendedType

source§

fn from(ty: Node<InterfaceType>) -> Self

Converts to this type from the input type.
source§

impl From<Node<ObjectType>> for ExtendedType

source§

fn from(ty: Node<ObjectType>) -> Self

Converts to this type from the input type.
source§

impl From<Node<ScalarType>> for ExtendedType

source§

fn from(ty: Node<ScalarType>) -> Self

Converts to this type from the input type.
source§

impl From<Node<UnionType>> for ExtendedType

source§

fn from(ty: Node<UnionType>) -> Self

Converts to this type from the input type.
source§

impl From<ObjectType> for ExtendedType

source§

fn from(ty: ObjectType) -> Self

Converts to this type from the input type.
source§

impl From<ScalarType> for ExtendedType

source§

fn from(ty: ScalarType) -> Self

Converts to this type from the input type.
source§

impl From<UnionType> for ExtendedType

source§

fn from(ty: UnionType) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ExtendedType

source§

fn eq(&self, other: &ExtendedType) -> 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 ExtendedType

source§

impl StructuralEq for ExtendedType

source§

impl StructuralPartialEq for ExtendedType

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> 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> 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, 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.