Struct glimesh::Client[][src]

pub struct Client<T, E> { /* fields omitted */ }

Glimesh client. The client is generic over its connection/transport, meaning it can be used with http or websockets (or any future transport Glimesh might support).

To create a client you first create the underlying connection/transport, such as crate::http::Connection.

Implementations

impl<T, E> Client<T, E>[src]

pub fn new(conn: T) -> Self[src]

Create a new client from a connection. Prefer calling into_client on the connection itself.

pub fn into_connection(self) -> T[src]

Turn this client back into its underlying connection

impl<T, E> Client<T, E> where
    T: QueryConn<Error = E>, 
[src]

pub async fn query<Q>(
    &self,
    variables: Q::Variables
) -> Result<Q::ResponseData, E> where
    Q: GraphQLQuery,
    Q::Variables: Send + Sync
[src]

Perform a graphql query using the underlying connection.

Errors

See QueryConn::query for error information

impl<T, E> Client<T, E> where
    T: MutationConn<Error = E>, 
[src]

pub async fn mutate<Q>(
    &self,
    variables: Q::Variables
) -> Result<Q::ResponseData, E> where
    Q: GraphQLQuery,
    Q::Variables: Send + Sync
[src]

Perform a graphql mutation using the underlying connection

Errors

See MutationConn::mutate for error information

impl<T, E> Client<T, E> where
    T: SubscriptionConn<Error = E>, 
[src]

pub async fn subscribe<'a, Q>(
    &self,
    variables: Q::Variables
) -> Result<BoxStream<'a, Q::ResponseData>, E> where
    Q: GraphQLQuery,
    Q::Variables: Send + Sync
[src]

Subscribe to a graphql subcription using the underlying connection.

Errors

See SubscriptionConn::subscribe for error information

Trait Implementations

impl<T: Clone, E> Clone for Client<T, E>[src]

impl<T: Debug, E> Debug for Client<T, E>[src]

Auto Trait Implementations

impl<T, E> RefUnwindSafe for Client<T, E> where
    E: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, E> Send for Client<T, E> where
    E: Send,
    T: Send

impl<T, E> Sync for Client<T, E> where
    E: Sync,
    T: Sync

impl<T, E> Unpin for Client<T, E> where
    E: Unpin,
    T: Unpin

impl<T, E> UnwindSafe for Client<T, E> where
    E: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,