Struct artemis::ClientBuilder[][src]

pub struct ClientBuilder<M: Exchange = TerminatorExchange> { /* fields omitted */ }

A builder for the artemis client.

Implementations

impl ClientBuilder<TerminatorExchange>[src]

pub fn new<U: Into<String>>(url: U) -> Self[src]

Creates a new builder with the URL of the GraphQL Endpoint

impl<M: Exchange> ClientBuilder<M>[src]

pub fn with_default_exchanges(self) -> ClientBuilder<impl Exchange>[src]

Add the default exchanges to the chain. Keep in mind that exchanges are executed bottom to top, so the first one added will be the last one executed. This is currently <-> DedupExchange <-> CacheExchange <-> FetchExchange

Requires feature: default-exchanges

pub fn with_exchange<TResult, F>(
    self,
    exchange_factory: F
) -> ClientBuilder<TResult> where
    TResult: Exchange + Send + Sync,
    F: ExchangeFactory<M, Output = TResult>, 
[src]

Add a middleware to the chain. Keep in mind that exchanges are executed bottom to top, so the first one added will be the last one executed.

pub fn with_extra_headers(
    self,
    header_fn: impl Fn() -> Vec<HeaderPair> + Send + Sync + 'static
) -> Self
[src]

Adds default headers to each query. This will be overridden if the QueryOptions include the same field. The function will be called on every request.

pub fn with_request_policy(self, request_policy: RequestPolicy) -> Self[src]

Sets the default RequestPolicy of each request. The default is CacheFirst

pub fn build(self) -> Client<M>[src]

Builds the client with the options from the builder

Auto Trait Implementations

impl<M = TerminatorExchange> !RefUnwindSafe for ClientBuilder<M>

impl<M> Send for ClientBuilder<M>

impl<M> Sync for ClientBuilder<M>

impl<M> Unpin for ClientBuilder<M> where
    M: Unpin

impl<M = TerminatorExchange> !UnwindSafe for ClientBuilder<M>

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> 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.