TypeDefinition

Enum TypeDefinition 

Source
pub enum TypeDefinition<'a, S: SchemaDefinition, W: Warden<SchemaDefinition = S>> {
    BuiltinScalar(BuiltinScalarDefinition),
    CustomScalar(ScalarTypeDefinition<'a, S, W>),
    Object(ObjectTypeDefinition<'a, S, W>),
    Interface(InterfaceTypeDefinition<'a, S, W>),
    InputObject(InputObjectTypeDefinition<'a, S, W>),
    Enum(EnumTypeDefinition<'a, S, W>),
    Union(UnionTypeDefinition<'a, S, W>),
}

Variants§

§

BuiltinScalar(BuiltinScalarDefinition)

§

CustomScalar(ScalarTypeDefinition<'a, S, W>)

§

Object(ObjectTypeDefinition<'a, S, W>)

§

Interface(InterfaceTypeDefinition<'a, S, W>)

§

InputObject(InputObjectTypeDefinition<'a, S, W>)

§

Enum(EnumTypeDefinition<'a, S, W>)

§

Union(UnionTypeDefinition<'a, S, W>)

Implementations§

Source§

impl<'a, S: SchemaDefinition, W: Warden<SchemaDefinition = S>> TypeDefinition<'a, S, W>

Source

pub fn is_builtin_scalar(&self) -> bool

Returns true if this is a TypeDefinition::BuiltinScalar, otherwise false

Source

pub fn as_builtin_scalar_mut(&mut self) -> Option<&mut BuiltinScalarDefinition>

Optionally returns mutable references to the inner fields if this is a TypeDefinition::BuiltinScalar, otherwise None

Source

pub fn as_builtin_scalar(&self) -> Option<&BuiltinScalarDefinition>

Optionally returns references to the inner fields if this is a TypeDefinition::BuiltinScalar, otherwise None

Source

pub fn into_builtin_scalar(self) -> Result<BuiltinScalarDefinition, Self>

Returns the inner fields if this is a TypeDefinition::BuiltinScalar, otherwise returns back the enum in the Err case of the result

Source

pub fn is_custom_scalar(&self) -> bool

Returns true if this is a TypeDefinition::CustomScalar, otherwise false

Source

pub fn as_custom_scalar_mut( &mut self, ) -> Option<&mut ScalarTypeDefinition<'a, S, W>>

Optionally returns mutable references to the inner fields if this is a TypeDefinition::CustomScalar, otherwise None

Source

pub fn as_custom_scalar(&self) -> Option<&ScalarTypeDefinition<'a, S, W>>

Optionally returns references to the inner fields if this is a TypeDefinition::CustomScalar, otherwise None

Source

pub fn into_custom_scalar(self) -> Result<ScalarTypeDefinition<'a, S, W>, Self>

Returns the inner fields if this is a TypeDefinition::CustomScalar, otherwise returns back the enum in the Err case of the result

Source

pub fn is_object(&self) -> bool

Returns true if this is a TypeDefinition::Object, otherwise false

Source

pub fn as_object_mut(&mut self) -> Option<&mut ObjectTypeDefinition<'a, S, W>>

Optionally returns mutable references to the inner fields if this is a TypeDefinition::Object, otherwise None

Source

pub fn as_object(&self) -> Option<&ObjectTypeDefinition<'a, S, W>>

Optionally returns references to the inner fields if this is a TypeDefinition::Object, otherwise None

Source

pub fn into_object(self) -> Result<ObjectTypeDefinition<'a, S, W>, Self>

Returns the inner fields if this is a TypeDefinition::Object, otherwise returns back the enum in the Err case of the result

Source

pub fn is_interface(&self) -> bool

Returns true if this is a TypeDefinition::Interface, otherwise false

Source

pub fn as_interface_mut( &mut self, ) -> Option<&mut InterfaceTypeDefinition<'a, S, W>>

Optionally returns mutable references to the inner fields if this is a TypeDefinition::Interface, otherwise None

Source

pub fn as_interface(&self) -> Option<&InterfaceTypeDefinition<'a, S, W>>

Optionally returns references to the inner fields if this is a TypeDefinition::Interface, otherwise None

Source

pub fn into_interface(self) -> Result<InterfaceTypeDefinition<'a, S, W>, Self>

Returns the inner fields if this is a TypeDefinition::Interface, otherwise returns back the enum in the Err case of the result

Source

pub fn is_input_object(&self) -> bool

Returns true if this is a TypeDefinition::InputObject, otherwise false

Source

pub fn as_input_object_mut( &mut self, ) -> Option<&mut InputObjectTypeDefinition<'a, S, W>>

Optionally returns mutable references to the inner fields if this is a TypeDefinition::InputObject, otherwise None

Source

pub fn as_input_object(&self) -> Option<&InputObjectTypeDefinition<'a, S, W>>

Optionally returns references to the inner fields if this is a TypeDefinition::InputObject, otherwise None

Source

pub fn into_input_object( self, ) -> Result<InputObjectTypeDefinition<'a, S, W>, Self>

Returns the inner fields if this is a TypeDefinition::InputObject, otherwise returns back the enum in the Err case of the result

Source

pub fn is_enum(&self) -> bool

Returns true if this is a TypeDefinition::Enum, otherwise false

Source

pub fn as_enum_mut(&mut self) -> Option<&mut EnumTypeDefinition<'a, S, W>>

Optionally returns mutable references to the inner fields if this is a TypeDefinition::Enum, otherwise None

Source

pub fn as_enum(&self) -> Option<&EnumTypeDefinition<'a, S, W>>

Optionally returns references to the inner fields if this is a TypeDefinition::Enum, otherwise None

Source

pub fn into_enum(self) -> Result<EnumTypeDefinition<'a, S, W>, Self>

Returns the inner fields if this is a TypeDefinition::Enum, otherwise returns back the enum in the Err case of the result

Source

pub fn is_union(&self) -> bool

Returns true if this is a TypeDefinition::Union, otherwise false

Source

pub fn as_union_mut(&mut self) -> Option<&mut UnionTypeDefinition<'a, S, W>>

Optionally returns mutable references to the inner fields if this is a TypeDefinition::Union, otherwise None

Source

pub fn as_union(&self) -> Option<&UnionTypeDefinition<'a, S, W>>

Optionally returns references to the inner fields if this is a TypeDefinition::Union, otherwise None

Source

pub fn into_union(self) -> Result<UnionTypeDefinition<'a, S, W>, Self>

Returns the inner fields if this is a TypeDefinition::Union, otherwise returns back the enum in the Err case of the result

Trait Implementations§

Auto Trait Implementations§

§

impl<'a, S, W> !Freeze for TypeDefinition<'a, S, W>

§

impl<'a, S, W> !RefUnwindSafe for TypeDefinition<'a, S, W>

§

impl<'a, S, W> !Send for TypeDefinition<'a, S, W>

§

impl<'a, S, W> !Sync for TypeDefinition<'a, S, W>

§

impl<'a, S, W> Unpin for TypeDefinition<'a, S, W>
where W: Unpin,

§

impl<'a, S, W> !UnwindSafe for TypeDefinition<'a, S, W>

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
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

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

Source§

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.