Struct juniper::executor::Executor [−][src]
pub struct Executor<'r, 'a, CtxT, S = DefaultScalarValue> where
CtxT: 'a,
S: 'a, { /* fields omitted */ }
Expand description
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]
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]
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 Value
s.
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]
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 Value
s.
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]
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]
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]
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]
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]
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]
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]
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]
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]
pub fn schema(&self) -> &'a SchemaType<'_, S>
[src]The currently executing schema
pub fn location(&self) -> &SourcePosition
[src]
pub fn location(&self) -> &SourcePosition
[src]The current location of the executor
pub fn push_error(&self, error: FieldError<S>)
[src]
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]
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]
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]
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]
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,
CtxT: RefUnwindSafe,
S: RefUnwindSafe,
impl<'r, 'a, CtxT, S> Send for Executor<'r, 'a, CtxT, S> where
CtxT: Sync,
S: Send + Sync,
CtxT: Sync,
S: Send + Sync,
impl<'r, 'a, CtxT, S> Sync for Executor<'r, 'a, CtxT, S> where
CtxT: Sync,
S: Send + Sync,
CtxT: Sync,
S: Send + Sync,
impl<'r, 'a, CtxT, S> Unpin for Executor<'r, 'a, CtxT, S> where
'a: 'r,
'a: 'r,
impl<'r, 'a, CtxT, S> UnwindSafe for Executor<'r, 'a, CtxT, S> where
CtxT: RefUnwindSafe,
S: RefUnwindSafe,
CtxT: RefUnwindSafe,
S: RefUnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,