pub struct Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>where
QueryT: GraphQLTypeAsync<S, Context = CtxT> + Send,
QueryT::TypeInfo: Send + Sync,
MutationT: GraphQLTypeAsync<S, Context = CtxT> + Send,
MutationT::TypeInfo: Send + Sync,
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT> + Send,
SubscriptionT::TypeInfo: Send + Sync,
CtxT: Sync,
S: ScalarValue + Send + Sync,{ /* private fields */ }Expand description
Simple SubscriptionCoordinator implementation:
- contains the schema
- handles subscription start
Implementations§
Source§impl<QueryT, MutationT, SubscriptionT, CtxT, S> Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>where
QueryT: GraphQLTypeAsync<S, Context = CtxT> + Send,
QueryT::TypeInfo: Send + Sync,
MutationT: GraphQLTypeAsync<S, Context = CtxT> + Send,
MutationT::TypeInfo: Send + Sync,
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT> + Send,
SubscriptionT::TypeInfo: Send + Sync,
CtxT: Sync,
S: ScalarValue + Send + Sync,
impl<QueryT, MutationT, SubscriptionT, CtxT, S> Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>where
QueryT: GraphQLTypeAsync<S, Context = CtxT> + Send,
QueryT::TypeInfo: Send + Sync,
MutationT: GraphQLTypeAsync<S, Context = CtxT> + Send,
MutationT::TypeInfo: Send + Sync,
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT> + Send,
SubscriptionT::TypeInfo: Send + Sync,
CtxT: Sync,
S: ScalarValue + Send + Sync,
Sourcepub fn new(root_node: RootNode<QueryT, MutationT, SubscriptionT, S>) -> Self
pub fn new(root_node: RootNode<QueryT, MutationT, SubscriptionT, S>) -> Self
Builds new Coordinator with specified root_node
Trait Implementations§
Source§impl<'a, QueryT, MutationT, SubscriptionT, CtxT, S> SubscriptionCoordinator<'a, CtxT, S> for Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>where
QueryT: GraphQLTypeAsync<S, Context = CtxT> + Send,
QueryT::TypeInfo: Send + Sync,
MutationT: GraphQLTypeAsync<S, Context = CtxT> + Send,
MutationT::TypeInfo: Send + Sync,
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT> + Send,
SubscriptionT::TypeInfo: Send + Sync,
CtxT: Sync,
S: ScalarValue + Send + Sync + 'a,
impl<'a, QueryT, MutationT, SubscriptionT, CtxT, S> SubscriptionCoordinator<'a, CtxT, S> for Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>where
QueryT: GraphQLTypeAsync<S, Context = CtxT> + Send,
QueryT::TypeInfo: Send + Sync,
MutationT: GraphQLTypeAsync<S, Context = CtxT> + Send,
MutationT::TypeInfo: Send + Sync,
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT> + Send,
SubscriptionT::TypeInfo: Send + Sync,
CtxT: Sync,
S: ScalarValue + Send + Sync + 'a,
Source§type Connection = Connection<'a, S>
type Connection = Connection<'a, S>
Type of
SubscriptionConnections this SubscriptionCoordinator
returnsSource§type Error = GraphQLError
type Error = GraphQLError
Type of error while trying to spawn
SubscriptionConnectionSource§fn subscribe(
&'a self,
req: &'a GraphQLRequest<S>,
context: &'a CtxT,
) -> BoxFuture<'a, Result<Self::Connection, Self::Error>>
fn subscribe( &'a self, req: &'a GraphQLRequest<S>, context: &'a CtxT, ) -> BoxFuture<'a, Result<Self::Connection, Self::Error>>
Return
SubscriptionConnection based on given GraphQLRequestAuto Trait Implementations§
impl<QueryT, MutationT, SubscriptionT, CtxT, S> Freeze for Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>where
QueryT: Freeze,
<QueryT as GraphQLValue<S>>::TypeInfo: Freeze,
MutationT: Freeze,
<MutationT as GraphQLValue<S>>::TypeInfo: Freeze,
SubscriptionT: Freeze,
<SubscriptionT as GraphQLValue<S>>::TypeInfo: Freeze,
impl<QueryT, MutationT, SubscriptionT, CtxT, S> RefUnwindSafe for Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>where
QueryT: RefUnwindSafe,
<QueryT as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
MutationT: RefUnwindSafe,
<MutationT as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
SubscriptionT: RefUnwindSafe,
<SubscriptionT as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
S: RefUnwindSafe,
impl<QueryT, MutationT, SubscriptionT, CtxT, S> Send for Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>
impl<QueryT, MutationT, SubscriptionT, CtxT, S> Sync for Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>
impl<QueryT, MutationT, SubscriptionT, CtxT, S> Unpin for Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>where
QueryT: Unpin,
<QueryT as GraphQLValue<S>>::TypeInfo: Unpin,
MutationT: Unpin,
<MutationT as GraphQLValue<S>>::TypeInfo: Unpin,
SubscriptionT: Unpin,
<SubscriptionT as GraphQLValue<S>>::TypeInfo: Unpin,
S: Unpin,
impl<QueryT, MutationT, SubscriptionT, CtxT, S> UnwindSafe for Coordinator<QueryT, MutationT, SubscriptionT, CtxT, S>where
QueryT: UnwindSafe,
<QueryT as GraphQLValue<S>>::TypeInfo: UnwindSafe,
MutationT: UnwindSafe,
<MutationT as GraphQLValue<S>>::TypeInfo: UnwindSafe,
SubscriptionT: UnwindSafe,
<SubscriptionT as GraphQLValue<S>>::TypeInfo: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more