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

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

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

Represents a GraphQL input type.

Required Associated Types§

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§

Type the name.

Create type information in the registry and return qualified typename.

Parse from Value. None represents undefined.

Convert to a Value for introspection.

Returns a reference to the raw value.

Provided Methods§

Qualified typename.

Examples found in repository?
src/types/external/secrecy.rs (line 15)
14
15
16
    fn qualified_type_name() -> String {
        T::qualified_type_name()
    }
More examples
Hide additional examples
src/types/external/list/hashbrown_hash_set.rs (line 18)
17
18
19
    fn qualified_type_name() -> String {
        <StdHashSet<T> as InputType>::qualified_type_name()
    }
src/types/external/list/array.rs (line 12)
11
12
13
14
15
16
17
18
19
20
21
22
    fn type_name() -> Cow<'static, str> {
        Cow::Owned(format!("[{}]", T::qualified_type_name()))
    }

    fn qualified_type_name() -> String {
        format!("[{}]!", T::qualified_type_name())
    }

    fn create_type_info(registry: &mut registry::Registry) -> String {
        T::create_type_info(registry);
        Self::qualified_type_name()
    }
src/types/external/list/btree_set.rs (line 12)
11
12
13
14
15
16
17
18
19
20
21
22
    fn type_name() -> Cow<'static, str> {
        Cow::Owned(format!("[{}]", T::qualified_type_name()))
    }

    fn qualified_type_name() -> String {
        format!("[{}]!", T::qualified_type_name())
    }

    fn create_type_info(registry: &mut registry::Registry) -> String {
        T::create_type_info(registry);
        Self::qualified_type_name()
    }
src/types/external/list/hash_set.rs (line 12)
11
12
13
14
15
16
17
18
19
20
21
22
    fn type_name() -> Cow<'static, str> {
        Cow::Owned(format!("[{}]", T::qualified_type_name()))
    }

    fn qualified_type_name() -> String {
        format!("[{}]!", T::qualified_type_name())
    }

    fn create_type_info(registry: &mut registry::Registry) -> String {
        T::create_type_info(registry);
        Self::qualified_type_name()
    }
src/types/external/list/linked_list.rs (line 12)
11
12
13
14
15
16
17
18
19
20
21
22
    fn type_name() -> Cow<'static, str> {
        Cow::Owned(format!("[{}]", T::qualified_type_name()))
    }

    fn qualified_type_name() -> String {
        format!("[{}]!", T::qualified_type_name())
    }

    fn create_type_info(registry: &mut registry::Registry) -> String {
        T::create_type_info(registry);
        Self::qualified_type_name()
    }

Implementations on Foreign Types§

Implementors§