Struct glimesh::hybrid::Connection
source · pub struct Connection<C, S> { /* private fields */ }
Expand description
A hybrid connection that allows combining two different connections into one effective connection, for example for using an http client for querying & mutating, and a websocket client for subscriptions.
Implementations§
source§impl<C, S> Connection<C, S>
impl<C, S> Connection<C, S>
sourcepub fn new(query_conn: C, subscription_conn: S) -> Self
pub fn new(query_conn: C, subscription_conn: S) -> Self
Create a new hybrid connection. The first connection will be used for query and mutate operations, and the second only for subscriptions.
sourcepub fn into_client(self) -> Client<Self>
pub fn into_client(self) -> Client<Self>
Convert this connection into a client
Trait Implementations§
source§impl<C, S> Debug for Connection<C, S>
impl<C, S> Debug for Connection<C, S>
source§impl<C, S> MutationConn for Connection<C, S>where
C: MutationConn + Send + Sync,
S: Send + Sync,
impl<C, S> MutationConn for Connection<C, S>where C: MutationConn + Send + Sync, S: Send + Sync,
§type Error = <C as MutationConn>::Error
type Error = <C as MutationConn>::Error
Error type representing any errors that can occurr when mutating
source§fn mutate<'life0, 'async_trait, Q>(
&'life0 self,
variables: Q::Variables
) -> Pin<Box<dyn Future<Output = Result<Q::ResponseData, Self::Error>> + Send + 'async_trait>>where
Q: GraphQLQuery + 'async_trait,
Q::Variables: Send + Sync,
Self: 'async_trait,
'life0: 'async_trait,
fn mutate<'life0, 'async_trait, Q>( &'life0 self, variables: Q::Variables ) -> Pin<Box<dyn Future<Output = Result<Q::ResponseData, Self::Error>> + Send + 'async_trait>>where Q: GraphQLQuery + 'async_trait, Q::Variables: Send + Sync, Self: 'async_trait, 'life0: 'async_trait,
Send a graphql mutation over this connection. Read more
source§impl<C, S> QueryConn for Connection<C, S>where
C: QueryConn + Send + Sync,
S: Send + Sync,
impl<C, S> QueryConn for Connection<C, S>where C: QueryConn + Send + Sync, S: Send + Sync,
§type Error = <C as QueryConn>::Error
type Error = <C as QueryConn>::Error
Error type representing any errors that can occurr when querying
source§fn query<'life0, 'async_trait, Q>(
&'life0 self,
variables: Q::Variables
) -> Pin<Box<dyn Future<Output = Result<Q::ResponseData, Self::Error>> + Send + 'async_trait>>where
Q: GraphQLQuery + 'async_trait,
Q::Variables: Send + Sync,
Self: 'async_trait,
'life0: 'async_trait,
fn query<'life0, 'async_trait, Q>( &'life0 self, variables: Q::Variables ) -> Pin<Box<dyn Future<Output = Result<Q::ResponseData, Self::Error>> + Send + 'async_trait>>where Q: GraphQLQuery + 'async_trait, Q::Variables: Send + Sync, Self: 'async_trait, 'life0: 'async_trait,
Send a graphql query over this connection. Read more
source§impl<C, S> SubscriptionConn for Connection<C, S>where
S: SubscriptionConn + Send + Sync,
C: Send + Sync,
impl<C, S> SubscriptionConn for Connection<C, S>where S: SubscriptionConn + Send + Sync, C: Send + Sync,
§type Error = <S as SubscriptionConn>::Error
type Error = <S as SubscriptionConn>::Error
Error type representing any errors that can occurr when subscribing
source§fn subscribe<'life0, 'async_trait, Q>(
&'life0 self,
variables: Q::Variables
) -> Pin<Box<dyn Future<Output = Result<Subscription<Q::ResponseData>, Self::Error>> + Send + 'async_trait>>where
Q: GraphQLQuery + 'async_trait,
Q::Variables: Send + Sync,
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait, Q>( &'life0 self, variables: Q::Variables ) -> Pin<Box<dyn Future<Output = Result<Subscription<Q::ResponseData>, Self::Error>> + Send + 'async_trait>>where Q: GraphQLQuery + 'async_trait, Q::Variables: Send + Sync, Self: 'async_trait, 'life0: 'async_trait,
Send a graphql subscription over this connection.
The future will resolve when the subscription has been established,
and then any messages will be sent on the returned stream Read more