[][src]Struct apollo_client::Client

pub struct Client<T: AsRef<str>, V: AsRef<[T]>> { /* fields omitted */ }

Represents the apollo client.

Methods

impl<S: AsRef<str> + Display, V: AsRef<[S]>> Client<S, V>[src]

pub fn with_config(client_config: ClientConfig<S, V>) -> Self[src]

New with the configuration of apollo and api parameters.

Example

use apollo_client::{Client, ClientConfig};
let client_config: ClientConfig<&'static str, &'static [&'static str]> = Default::default();
let _ = Client::with_config(client_config);

pub async fn request<'_, T: FromResponses<Err = ApolloClientError>>(
    &'_ self
) -> ApolloClientResult<T>
[src]

Request apollo config api, and return response of your favorite type.

pub async fn request_with_extras_query<'_, '_, '_, '_, T: FromResponses<Err = ApolloClientError>>(
    &'_ self,
    extras_query: Option<&'_ [(&'_ str, &'_ str)]>
) -> ApolloClientResult<T>
[src]

Request apollo config api, and return response of your favorite type, with extras query.

pub async fn listen_once<'_>(&'_ mut self) -> ApolloClientResult<()>[src]

Request apollo notification api just once.

pub async fn listen_and_request<'_, T: FromResponses<Err = ApolloClientError>>(
    &'_ mut self
) -> ApolloClientResult<T>
[src]

Loop and request apollo notification api, if there is a change of the namespaces, return the response of your favorite type, or ApolloClientError if there is something wrong.

pub async fn listen_and_request_with_extras_query<'_, '_, '_, '_, T: FromResponses<Err = ApolloClientError>>(
    &'_ mut self,
    extras_query: Option<&'_ [(&'_ str, &'_ str)]>
) -> ApolloClientResult<T>
[src]

Loop and request apollo notification api, if there is a change of the namespaces, return the response of your favorite type, or ApolloClientError if there is something wrong.

Auto Trait Implementations

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

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

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

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

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