Struct glimesh::Client[][src]

pub struct Client<T> { /* 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 conneciton/transport, such as crate::http::Connection.

Implementations

impl<T> Client<T>[src]

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

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

impl<T> Client<T> where
    T: QueryConn
[src]

pub async fn query<Q>(
    &self,
    variables: Q::Variables
) -> Result<Q::ResponseData, Error> 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> Client<T> where
    T: MutationConn
[src]

pub async fn mutate<Q>(
    &self,
    variables: Q::Variables
) -> Result<Q::ResponseData, Error> 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> Client<T> where
    T: SubscriptionConn
[src]

pub async fn subscribe<Q>(
    &self,
    variables: Q::Variables
) -> Result<impl Stream<Item = Q::ResponseData>, Error> where
    Q: GraphQLQuery,
    Q::Variables: Send + Sync
[src]

Subscribe to a graphql subcription using the underlying connection. This method is a shortcut for calling Self::subscribe_with_opts with default options.

Errors

See SubscriptionConn::subscribe for error information

pub async fn subscribe_with_opts<Q>(
    &self,
    variables: Q::Variables,
    opts: SubscribeOpts
) -> Result<impl Stream<Item = Q::ResponseData>, Error> where
    Q: GraphQLQuery,
    Q::Variables: Send + Sync
[src]

Subscribe to a graphql subcription using the underlying connection.

Errors

See SubscriptionConn::subscribe for error information

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Client<T> where
    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, 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.