pub trait InputType: Send + Sync + Sized {
    type RawValueType;

    // Required methods
    fn type_name() -> Cow<'static, str>;
    fn create_type_info(registry: &mut Registry) -> String;
    fn parse(value: Option<Value>) -> InputValueResult<Self>;
    fn to_value(&self) -> Value;
    fn as_raw_value(&self) -> Option<&Self::RawValueType>;

    // Provided method
    fn qualified_type_name() -> String { ... }
}
Expand description

Represents a GraphQL input type.

Required Associated Types§

source

type RawValueType

The raw type used for validator.

Usually it is Self, but the wrapper type is its internal type.

For example:

i32::RawValueType is i32 Option<i32>::RawValueType is i32.

Required Methods§

source

fn type_name() -> Cow<'static, str>

Type the name.

source

fn create_type_info(registry: &mut Registry) -> String

Create type information in the registry and return qualified typename.

source

fn parse(value: Option<Value>) -> InputValueResult<Self>

Parse from Value. None represents undefined.

source

fn to_value(&self) -> Value

Convert to a Value for introspection.

source

fn as_raw_value(&self) -> Option<&Self::RawValueType>

Returns a reference to the raw value.

Provided Methods§

source

fn qualified_type_name() -> String

Qualified typename.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl InputType for Bson

§

type RawValueType = Bson

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Tz

§

type RawValueType = Tz

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Value

§

type RawValueType = Value

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for bool

§

type RawValueType = bool

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for char

§

type RawValueType = char

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for f32

§

type RawValueType = f32

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for f64

§

type RawValueType = f64

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for i8

§

type RawValueType = i8

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for i16

§

type RawValueType = i16

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for i32

§

type RawValueType = i32

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for i64

§

type RawValueType = i64

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for isize

§

type RawValueType = isize

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for u8

§

type RawValueType = u8

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for u16

§

type RawValueType = u16

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for u32

§

type RawValueType = u32

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for u64

§

type RawValueType = u64

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for usize

§

type RawValueType = usize

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Box<str>

§

type RawValueType = Box<str>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for String

§

type RawValueType = String

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Arc<str>

§

type RawValueType = Arc<str>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for BigDecimal

§

type RawValueType = BigDecimal

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for DateTime

§

type RawValueType = DateTime

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Document

§

type RawValueType = Document

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for ObjectId

§

type RawValueType = ObjectId

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Uuid

§

type RawValueType = Uuid

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Bytes

§

type RawValueType = Bytes

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for DateTime<FixedOffset>

source§

impl InputType for DateTime<Local>

§

type RawValueType = DateTime<Local>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for DateTime<Utc>

§

type RawValueType = DateTime<Utc>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NaiveDate

§

type RawValueType = NaiveDate

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NaiveDateTime

§

type RawValueType = NaiveDateTime

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NaiveTime

§

type RawValueType = NaiveTime

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Decimal

§

type RawValueType = Decimal

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for SmolStr

§

type RawValueType = SmolStr

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Date

§

type RawValueType = Date

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for OffsetDateTime

§

type RawValueType = OffsetDateTime

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for PrimitiveDateTime

source§

impl InputType for Url

§

type RawValueType = Url

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Uuid

§

type RawValueType = Uuid

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NonZeroI8

§

type RawValueType = NonZero<i8>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NonZeroI16

§

type RawValueType = NonZero<i16>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NonZeroI32

§

type RawValueType = NonZero<i32>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NonZeroI64

§

type RawValueType = NonZero<i64>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NonZeroU8

§

type RawValueType = NonZero<u8>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NonZeroU16

§

type RawValueType = NonZero<u16>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NonZeroU32

§

type RawValueType = NonZero<u32>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for NonZeroU64

§

type RawValueType = NonZero<u64>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl InputType for Duration

§

type RawValueType = TimeDelta

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl<K, V> InputType for BTreeMap<K, V>

§

type RawValueType = BTreeMap<K, V>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl<K, V> InputType for HashMap<K, V>

§

type RawValueType = HashMap<K, V>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl<K, V, S> InputType for HashMap<K, V, S>

§

type RawValueType = HashMap<K, V, S>

source§

fn type_name() -> Cow<'static, str>

source§

fn create_type_info(registry: &mut Registry) -> String

source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

source§

fn to_value(&self) -> Value

source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

source§

impl<T: InputType + Ord> InputType for BTreeSet<T>

source§

impl<T: InputType + Hash + Eq> InputType for HashSet<T>

source§

impl<T: InputType + Hash + Eq> InputType for HashSet<T>

source§

impl<T: InputType + Zeroize> InputType for Secret<T>

source§

impl<T: InputType> InputType for Option<T>

source§

impl<T: InputType> InputType for Box<[T]>

source§

impl<T: InputType> InputType for Box<T>

source§

impl<T: InputType> InputType for LinkedList<T>

source§

impl<T: InputType> InputType for VecDeque<T>

source§

impl<T: InputType> InputType for Arc<[T]>

source§

impl<T: InputType> InputType for Arc<T>

source§

impl<T: InputType> InputType for Vec<T>

source§

impl<T: InputType, const N: usize> InputType for [T; N]

Implementors§