Trait async_graphql::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§
sourcetype RawValueType
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§
sourcefn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
sourcefn parse(value: Option<Value>) -> InputValueResult<Self>
fn parse(value: Option<Value>) -> InputValueResult<Self>
Parse from Value
. None represents undefined.
sourcefn as_raw_value(&self) -> Option<&Self::RawValueType>
fn as_raw_value(&self) -> Option<&Self::RawValueType>
Returns a reference to the raw value.
Provided Methods§
sourcefn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
Object Safety§
This trait is not object safe.