Struct glimesh::Client [−][src]
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]
T: QueryConn,
pub async fn query<Q>(
&self,
variables: Q::Variables
) -> Result<Q::ResponseData, Error> where
Q: GraphQLQuery,
Q::Variables: Send + Sync,
[src]
&self,
variables: Q::Variables
) -> Result<Q::ResponseData, Error> where
Q: GraphQLQuery,
Q::Variables: Send + Sync,
Perform a graphql query using the underlying connection.
Errors
See QueryConn::query
for error information
impl<T> Client<T> where
T: MutationConn,
[src]
T: MutationConn,
pub async fn mutate<Q>(
&self,
variables: Q::Variables
) -> Result<Q::ResponseData, Error> where
Q: GraphQLQuery,
Q::Variables: Send + Sync,
[src]
&self,
variables: Q::Variables
) -> Result<Q::ResponseData, Error> where
Q: GraphQLQuery,
Q::Variables: Send + Sync,
Perform a graphql mutation using the underlying connection
Errors
See MutationConn::mutate
for error information
impl<T> Client<T> where
T: SubscriptionConn,
[src]
T: SubscriptionConn,
pub async fn subscribe<Q>(
&self,
variables: Q::Variables
) -> Result<impl Stream<Item = Q::ResponseData>, Error> where
Q: GraphQLQuery,
Q::Variables: Send + Sync,
[src]
&self,
variables: Q::Variables
) -> Result<impl Stream<Item = Q::ResponseData>, Error> where
Q: GraphQLQuery,
Q::Variables: Send + Sync,
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]
&self,
variables: Q::Variables,
opts: SubscribeOpts
) -> Result<impl Stream<Item = Q::ResponseData>, Error> where
Q: GraphQLQuery,
Q::Variables: Send + Sync,
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,
T: RefUnwindSafe,
impl<T> Send for Client<T> where
T: Send,
T: Send,
impl<T> Sync for Client<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Client<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Client<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,