[][src]Struct juniper::Executor

pub struct Executor<'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.

Methods

impl<'a, CtxT, S> Executor<'a, CtxT, S> where
    S: ScalarValue,
    &'b S: ScalarRefValue<'b>, 
[src]

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

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

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

Resolve a single arbitrary value into an ExecutionResult

pub fn resolve_into_value<T>(&self, info: &T::TypeInfo, value: &T) -> Value<S> where
    T: GraphQLType<S, Context = CtxT>, 
[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, 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) -> &'a 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 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.

Auto Trait Implementations

impl<'a, CtxT, S> Send for Executor<'a, CtxT, S> where
    CtxT: Sync,
    S: Send + Sync

impl<'a, CtxT, S> Sync for Executor<'a, CtxT, S> where
    CtxT: Sync,
    S: Send + Sync

Blanket Implementations

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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