async_graphql

Trait OutputType

Source
pub trait OutputType: Send + Sync {
    // Required methods
    fn type_name() -> Cow<'static, str>;
    fn create_type_info(registry: &mut Registry) -> String;
    fn resolve(
        &self,
        ctx: &ContextSelectionSet<'_>,
        field: &Positioned<Field>,
    ) -> impl Future<Output = ServerResult<Value>> + Send;

    // Provided methods
    fn qualified_type_name() -> String { ... }
    fn introspection_type_name(&self) -> Cow<'static, str> { ... }
}
Expand description

Represents a GraphQL output type.

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 resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> impl Future<Output = ServerResult<Value>> + Send

Resolve an output value to async_graphql::Value.

Provided Methods§

Source

fn qualified_type_name() -> String

Qualified typename.

Source

fn introspection_type_name(&self) -> Cow<'static, str>

Introspection type name

Is the return value of field __typename, the interface and union should return the current type, and the others return Type::type_name.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl OutputType for Value

Source§

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

Source§

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

Source§

async fn resolve( &self, _ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for bool

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for char

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for f32

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for f64

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for i8

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for i16

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for i32

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for i64

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for isize

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for str

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for u8

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for u16

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for u32

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for u64

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for usize

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for Bytes

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for String

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for NonZeroI8

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for NonZeroI16

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for NonZeroI32

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for NonZeroI64

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for NonZeroU8

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for NonZeroU16

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for NonZeroU32

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl OutputType for NonZeroU64

Source§

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

Source§

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

Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<'a, T> OutputType for Cow<'a, T>
where T: OutputType + ToOwned + ?Sized, <T as ToOwned>::Owned: Send + Sync,

Source§

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

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<'a, T: OutputType + 'a> OutputType for &'a [T]

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<K, V> OutputType for BTreeMap<K, V>
where K: ToString + Ord + Send + Sync, V: Serialize + Send + Sync,

Source§

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

Source§

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

Source§

async fn resolve( &self, _ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<K, V, S> OutputType for HashMap<K, V, S>
where K: ToString + Eq + Hash + Send + Sync, V: Serialize + Send + Sync, S: Send + Sync,

Source§

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

Source§

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

Source§

async fn resolve( &self, _ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

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

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

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

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<T: OutputType + Sync> OutputType for Option<T>

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<T: OutputType + ?Sized> OutputType for &T

Source§

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

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<T: OutputType + ?Sized> OutputType for Box<T>

Source§

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

Source§

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

Source§

fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> impl Future<Output = ServerResult<Value>> + Send

Source§

impl<T: OutputType + ?Sized> OutputType for Arc<T>

Source§

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

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<T: OutputType + ?Sized> OutputType for Weak<T>

Source§

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

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

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

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<T: OutputType> OutputType for LinkedList<T>

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<T: OutputType> OutputType for VecDeque<T>

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

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

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

impl<T: OutputType> OutputType for Vec<T>

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Source§

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

Source§

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

Source§

fn qualified_type_name() -> String

Source§

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

Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, field: &Positioned<Field>, ) -> ServerResult<Value>

Implementors§

Source§

impl OutputType for EmptyFields

Source§

impl OutputType for PageInfo

Source§

impl OutputType for Any

Source§

impl OutputType for EmptyMutation

Source§

impl OutputType for ID

Source§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> OutputType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, DisableNodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType,

Source§

impl<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName> OutputType for Connection<Cursor, Node, ConnectionFields, EdgeFields, Name, EdgeName, EnableNodesField>
where Cursor: CursorType + Send + Sync, Node: OutputType, ConnectionFields: ObjectType, EdgeFields: ObjectType, Name: ConnectionNameType, EdgeName: EdgeNameType,

Source§

impl<Cursor, Node, EdgeFields, Name> OutputType for Edge<Cursor, Node, EdgeFields, Name>
where Cursor: CursorType + Send + Sync, Node: OutputType, EdgeFields: ObjectType, Name: EdgeNameType,

Source§

impl<T: Serialize + Send + Sync> OutputType for Json<T>

Source§

impl<T: OutputType + Sync, E: Into<Error> + Send + Sync + Clone> OutputType for Result<T, E>