Enum juniper::meta::MetaType

source ·
pub enum MetaType<'a, S = DefaultScalarValue> {
    // some variants omitted
}
Expand description

Generic type metadata

Implementations§

source§

impl<'a, S> MetaType<'a, S>

source

pub fn name(&self) -> Option<&str>

Access the name of the type, if applicable

Lists, non-null wrappers, and placeholders don’t have names.

source

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

Access the description of the type, if applicable

Lists, nullable wrappers, and placeholders don’t have names.

source

pub fn type_kind(&self) -> TypeKind

Construct a TypeKind for a given type

Panics

Panics if the type represents a placeholder or nullable type.

source

pub fn field_by_name(&self, name: &str) -> Option<&Field<'_, S>>

Access a field’s meta data given its name

Only objects and interfaces have fields. This method always returns None for other types.

source

pub fn input_field_by_name(&self, name: &str) -> Option<&Argument<'_, S>>

Access an input field’s meta data given its name

Only input objects have input fields. This method always returns None for other types.

source

pub fn as_type(&self) -> Type<'a>

Construct a Type literal instance based on the metadata

source

pub fn input_value_parse_fn(
    &self
) -> Option<for<'b> fn(_: &'b InputValue<S>) -> bool>

Access the input value parse function, if applicable

An input value parse function is a function that takes an InputValue instance and returns true if it can be parsed as the provided type.

Only scalars, enums, and input objects have parse functions.

source

pub fn is_composite(&self) -> bool

Returns true if the type is a composite type

Objects, interfaces, and unions are composite.

source

pub fn is_leaf(&self) -> bool

Returns true if the type can occur in leaf positions in queries

Only enums and scalars are leaf types.

source

pub fn is_abstract(&self) -> bool

Returns true if the type is abstract

Only interfaces and unions are abstract types.

source

pub fn is_input(&self) -> bool

Returns true if the type can be used in input positions, e.g. arguments or variables

Only scalars, enums, and input objects are input types.

source

pub fn is_builtin(&self) -> bool

Returns true if the type is built-in to GraphQL.

Trait Implementations§

source§

impl<'a, S: Debug> Debug for MetaType<'a, S>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, S> RefUnwindSafe for MetaType<'a, S>where
    S: RefUnwindSafe,

§

impl<'a, S> Send for MetaType<'a, S>where
    S: Send,

§

impl<'a, S> Sync for MetaType<'a, S>where
    S: Sync,

§

impl<'a, S> Unpin for MetaType<'a, S>where
    S: Unpin,

§

impl<'a, S> UnwindSafe for MetaType<'a, S>where
    S: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere
    V: MultiLane<T>,

§

fn vzip(self) -> V