[−][src]Struct apollo_client::Client
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]
&'_ self
) -> ApolloClientResult<T>
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]
&'_ self,
extras_query: Option<&'_ [(&'_ str, &'_ str)]>
) -> ApolloClientResult<T>
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]
&'_ mut self
) -> ApolloClientResult<T>
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]
&'_ mut self,
extras_query: Option<&'_ [(&'_ str, &'_ str)]>
) -> ApolloClientResult<T>
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,
T: RefUnwindSafe,
V: RefUnwindSafe,
impl<T, V> Send for Client<T, V> where
T: Send,
V: Send,
T: Send,
V: Send,
impl<T, V> Sync for Client<T, V> where
T: Sync,
V: Sync,
T: Sync,
V: Sync,
impl<T, V> Unpin for Client<T, V> where
T: Unpin,
V: Unpin,
T: Unpin,
V: Unpin,
impl<T, V> UnwindSafe for Client<T, V> where
T: UnwindSafe,
V: UnwindSafe,
T: UnwindSafe,
V: 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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[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.
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>,