async_graphql

Trait InputType

source
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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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>

source§

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

source§

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>

source§

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

source§

impl InputType for DateTime

source§

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

source§

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

source§

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

source§

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

source§

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>

source§

impl InputType for DateTime<Utc>

source§

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

source§

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

source§

impl InputType for NaiveTime

source§

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

source§

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

source§

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

source§

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

source§

impl InputType for PrimitiveDateTime

source§

impl InputType for Url

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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 NonZeroIsize

source§

type RawValueType = NonZero<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 NonZeroU8

source§

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

source§

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

source§

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

source§

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 NonZeroUsize

source§

type RawValueType = NonZero<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 Duration

source§

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>

source§

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>

source§

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>

source§

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§