Struct artemis::ClientBuilder [−][src]
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]
self,
exchange_factory: F
) -> ClientBuilder<TResult> where
TResult: Exchange + Send + Sync,
F: ExchangeFactory<M, Output = TResult>,
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]
self,
header_fn: impl Fn() -> Vec<HeaderPair> + Send + Sync + 'static
) -> Self
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,
M: Unpin,
impl<M = TerminatorExchange> !UnwindSafe for ClientBuilder<M>
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> 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>,