[][src]Struct reqwest_mock::client::GenericClient

pub struct GenericClient { /* fields omitted */ }

Provides an interface over the different client types which you can use in your code if you want to avoid it having to be generic over the Client trait.

Implementations

impl GenericClient[src]

pub fn direct() -> Self[src]

Create a GenericClient using DirectClient internally.

pub fn replay_file<P: Into<PathBuf>>(replay_file: P) -> Self[src]

Create a GenericClient using ReplayClient internally, recording one single request to one single replay file. If a differing request is made, the file will be overwritten again.

pub fn replay_dir<P: Into<PathBuf>>(replay_dir: P) -> Self[src]

Create a GenericClient using ReplayClient internally, recording multiple requests to a single directory. Each unique request will get its own replay file independent of other requests in the specified directory.

pub fn stub(client: StubClient) -> Self[src]

Create a GenericClient using StubClient internally.

pub fn force_record_next(&self)[src]

If this is a ReplayClient it will inform the Replay Client that whichever next request is made should be recorded again, even if it has been made exactly this way before.

Trait Implementations

impl Client for GenericClient[src]

impl From<DirectClient> for GenericClient[src]

impl From<ReplayClient> for GenericClient[src]

impl From<StubClient> for GenericClient[src]

Auto Trait Implementations

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,