Skip to main content

Executor

Trait Executor 

Source
pub trait Executor:
    Unpin
    + Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        request: Request,
    ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute_stream(
        &self,
        request: Request,
        session_data: Option<Arc<Data>>,
    ) -> BoxStream<'static, Response>;

    // Provided method
    fn execute_batch<'life0, 'async_trait>(
        &'life0 self,
        batch_request: BatchRequest,
    ) -> Pin<Box<dyn Future<Output = BatchResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Represents a GraphQL executor

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, request: Request, ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature boxed-trait only.

Execute a GraphQL query.

Source

fn execute_stream( &self, request: Request, session_data: Option<Arc<Data>>, ) -> BoxStream<'static, Response>

Execute a GraphQL subscription with session data.

Provided Methods§

Source

fn execute_batch<'life0, 'async_trait>( &'life0 self, batch_request: BatchRequest, ) -> Pin<Box<dyn Future<Output = BatchResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature boxed-trait only.

Execute a GraphQL batch query.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Executor for async_graphql::dynamic::Schema

Available on crate feature dynamic-schema only.
Source§

impl<Query, Mutation, Subscription> Executor for async_graphql::Schema<Query, Mutation, Subscription>
where Query: ObjectType + 'static, Mutation: ObjectType + 'static, Subscription: SubscriptionType + 'static,