[][src]Struct juniper::Executor

pub struct Executor<'r, 'a, CtxT, S = DefaultScalarValue> where
    CtxT: 'a,
    S: 'a, 
{ /* fields omitted */ }

Query execution engine

The executor helps drive the query execution in a schema. It keeps track of the current field stack, context, variables, and errors.

Implementations

impl<'r, 'a, CtxT, S> Executor<'r, 'a, CtxT, S> where
    S: ScalarValue
[src]

pub async fn resolve_into_stream<'i, 'v, 'res, T: ?Sized>(
    &'r self,
    info: &'i T::TypeInfo,
    value: &'v T
) -> Value<ValuesStream<'res, S>> where
    'i: 'res,
    'v: 'res,
    'a: 'res,
    T: GraphQLSubscriptionValue<S, Context = CtxT>,
    T::TypeInfo: Sync,
    CtxT: Sync,
    S: Send + Sync
[src]

Resolve a single arbitrary value into a stream of Values. If a field fails to resolve, pushes error to Executor and returns Value::Null.

pub async fn subscribe<'s, 't, 'res, T: ?Sized>(
    &'r self,
    info: &'t T::TypeInfo,
    value: &'t T
) -> Result<Value<ValuesStream<'res, S>>, FieldError<S>> where
    't: 'res,
    'a: 'res,
    T: GraphQLSubscriptionValue<S, Context = CtxT>,
    T::TypeInfo: Sync,
    CtxT: Sync,
    S: Send + Sync
[src]

Resolve a single arbitrary value into a stream of Values. Calls resolve_into_stream on T.

pub fn resolve_with_ctx<NewCtxT, T: ?Sized>(
    &self,
    info: &T::TypeInfo,
    value: &T
) -> ExecutionResult<S> where
    NewCtxT: FromContext<CtxT>,
    T: GraphQLValue<S, Context = NewCtxT>, 
[src]

Resolve a single arbitrary value, mapping the context to a new type

pub fn resolve<T: ?Sized>(
    &self,
    info: &T::TypeInfo,
    value: &T
) -> ExecutionResult<S> where
    T: GraphQLValue<S, Context = CtxT>, 
[src]

Resolve a single arbitrary value into an ExecutionResult

pub async fn resolve_async<T: ?Sized>(
    &self,
    info: &T::TypeInfo,
    value: &T
) -> ExecutionResult<S> where
    T: GraphQLValueAsync<S, Context = CtxT>,
    T::TypeInfo: Sync,
    CtxT: Sync,
    S: Send + Sync
[src]

Resolve a single arbitrary value into an ExecutionResult

pub async fn resolve_with_ctx_async<NewCtxT, T: ?Sized>(
    &self,
    info: &T::TypeInfo,
    value: &T
) -> ExecutionResult<S> where
    T: GraphQLValueAsync<S, Context = NewCtxT>,
    T::TypeInfo: Sync,
    NewCtxT: FromContext<CtxT> + Sync,
    S: Send + Sync
[src]

Resolve a single arbitrary value, mapping the context to a new type

pub fn resolve_into_value<T>(&self, info: &T::TypeInfo, value: &T) -> Value<S> where
    T: GraphQLValue<S, Context = CtxT>, 
[src]

Resolve a single arbitrary value into a return value

If the field fails to resolve, null will be returned.

pub async fn resolve_into_value_async<T: ?Sized>(
    &self,
    info: &T::TypeInfo,
    value: &T
) -> Value<S> where
    T: GraphQLValueAsync<S, Context = CtxT>,
    T::TypeInfo: Sync,
    CtxT: Sync,
    S: Send + Sync
[src]

Resolve a single arbitrary value into a return value

If the field fails to resolve, null will be returned.

pub fn replaced_context<'b, NewCtxT>(
    &'b self,
    ctx: &'b NewCtxT
) -> Executor<'b, 'b, NewCtxT, S>
[src]

Derive a new executor by replacing the context

This can be used to connect different types, e.g. from different Rust libraries, that require different context types.

pub fn context(&self) -> &'r CtxT[src]

Access the current context

You usually provide the context when calling the top-level execute function, or using the context factory in the Iron integration.

pub fn schema(&self) -> &'a SchemaType<'_, S>[src]

The currently executing schema

pub fn location(&self) -> &SourcePosition[src]

The current location of the executor

pub fn push_error(&self, error: FieldError<S>)[src]

Add an error to the execution engine at the current executor location

pub fn push_error_at(&self, error: FieldError<S>, location: SourcePosition)[src]

Add an error to the execution engine at a specific location

pub fn new_error(&self, error: FieldError<S>) -> ExecutionError<S>[src]

Returns new ExecutionError at current location

pub fn look_ahead(&'a self) -> LookAheadSelection<'a, S>[src]

Construct a lookahead selection for the current selection.

This allows seeing the whole selection and perform operations affecting the children.

pub fn as_owned_executor(&self) -> OwnedExecutor<'a, CtxT, S>[src]

Create new OwnedExecutor and clone all current data (except for errors) there

New empty vector is created for errors because existing errors won't be needed to be accessed by user in OwnedExecutor as existing errors will be returned in execute_query/execute_mutation/resolve_into_stream/etc.

Auto Trait Implementations

impl<'r, 'a, CtxT, S> RefUnwindSafe for Executor<'r, 'a, CtxT, S> where
    CtxT: RefUnwindSafe,
    S: RefUnwindSafe
[src]

impl<'r, 'a, CtxT, S> Send for Executor<'r, 'a, CtxT, S> where
    CtxT: Sync,
    S: Send + Sync
[src]

impl<'r, 'a, CtxT, S> Sync for Executor<'r, 'a, CtxT, S> where
    CtxT: Sync,
    S: Send + Sync
[src]

impl<'r, 'a, CtxT, S> Unpin for Executor<'r, 'a, CtxT, S> where
    'a: 'r, 
[src]

impl<'r, 'a, CtxT, S> UnwindSafe for Executor<'r, 'a, CtxT, S> where
    CtxT: RefUnwindSafe,
    S: RefUnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,