Struct glimesh::ws::Connection
source · pub struct Connection { /* private fields */ }
Expand description
Connect to glimesh over websockets
Implementations§
source§impl Connection
impl Connection
sourcepub fn builder() -> ConnectionBuilder
pub fn builder() -> ConnectionBuilder
Create a ConnectionBuilder
to configure various options.
sourcepub async fn connect(auth: Auth) -> Result<Self, WebsocketConnectionError>
pub async fn connect(auth: Auth) -> Result<Self, WebsocketConnectionError>
Create a connection with the default options.
sourcepub fn to_client(&self) -> WebsocketClient
pub fn to_client(&self) -> WebsocketClient
Create a client with a clone of this connection
sourcepub fn into_client(self) -> WebsocketClient
pub fn into_client(self) -> WebsocketClient
Convert this connection into a client
Trait Implementations§
source§impl Clone for Connection
impl Clone for Connection
source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Connection
impl Debug for Connection
source§impl MutationConn for Connection
impl MutationConn for Connection
§type Error = WebsocketConnectionError
type Error = WebsocketConnectionError
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 QueryConn for Connection
impl QueryConn for Connection
§type Error = WebsocketConnectionError
type Error = WebsocketConnectionError
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 SubscriptionConn for Connection
impl SubscriptionConn for Connection
§type Error = WebsocketConnectionError
type Error = WebsocketConnectionError
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