anterofit

Struct AdapterBuilder

Source
pub struct AdapterBuilder<S, D, E, I> { /* private fields */ }
Expand description

A builder for Adapter. Call Adapter::builder() to get an instance.

Implementations§

Source§

impl<S, D, E, I> AdapterBuilder<S, D, E, I>

Source

pub fn base_url(self, url: Url) -> Self

Set the base URL that the adapter will use for all requests.

If a base URL is not provided, then all service method URLs are assumed to be absolute.

Source

pub fn client(self, client: Client) -> Self

Set a hyper::Client instance to use with the adapter.

If not supplied, a default instance will be constructed.

Source

pub fn executor<E_>(self, executor: E_) -> AdapterBuilder<S, D, E_, I>
where E: Executor,

Set a new executor for the adapter.

Source

pub fn interceptor<I_>(self, interceptor: I_) -> AdapterBuilder<S, D, E, I_>
where I_: Interceptor,

Set a new interceptor for the adapter.

Source

pub fn chain_interceptor<I_>( self, next: I_, ) -> AdapterBuilder<S, D, E, Chain<I, I_>>
where I: Interceptor, I_: Interceptor,

Chain a new interceptor with the current one. They will be called in-order.

Source

pub fn serializer<S_>(self, serialize: S_) -> AdapterBuilder<S_, D, E, I>
where S_: Serializer,

Set a new Serializer impl for the adapter.

Source

pub fn deserializer<D_>(self, deserialize: D_) -> AdapterBuilder<S, D_, E, I>
where D_: Deserializer,

Set a new Deserializer impl for the adapter.

Source§

impl<S, D, E, I> AdapterBuilder<S, D, E, I>

Source

pub fn serialize_json(self) -> AdapterBuilder<Serializer, Deserializer, E, I>

Convenience method for using JSON serialization.

Enabled with either the rust-serialize feature or the serde-json feature.

Source§

impl<S, D, E, I> AdapterBuilder<S, D, E, I>

Source

pub fn build(self) -> Adapter<S, D>

Using the supplied types, complete the adapter.

<E as Executor>::start() will be called here.

Auto Trait Implementations§

§

impl<S, D, E, I> Freeze for AdapterBuilder<S, D, E, I>
where E: Freeze, I: Freeze, S: Freeze, D: Freeze,

§

impl<S, D, E, I> !RefUnwindSafe for AdapterBuilder<S, D, E, I>

§

impl<S, D, E, I> Send for AdapterBuilder<S, D, E, I>
where E: Send, I: Send, S: Send, D: Send,

§

impl<S, D, E, I> Sync for AdapterBuilder<S, D, E, I>
where E: Sync, I: Sync, S: Sync, D: Sync,

§

impl<S, D, E, I> Unpin for AdapterBuilder<S, D, E, I>
where E: Unpin, I: Unpin, S: Unpin, D: Unpin,

§

impl<S, D, E, I> !UnwindSafe for AdapterBuilder<S, D, E, I>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Typeable for T
where T: Any,

Source§

fn get_type(&self) -> TypeId

Get the TypeId of this object.
Source§

impl<T> Erased for T