async_graphql

Trait Executor

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

    // Provided method
    fn execute_batch(
        &self,
        batch_request: BatchRequest,
    ) -> impl Future<Output = BatchResponse> + Send { ... }
}
Expand description

Represents a GraphQL executor

Required Methods§

Source

fn execute(&self, request: Request) -> impl Future<Output = Response> + Send

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( &self, batch_request: BatchRequest, ) -> impl Future<Output = BatchResponse> + Send

Execute a GraphQL batch query.

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.

Implementors§

Source§

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