[−][src]Struct reqwest_mock::client::GenericClient
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]
fn execute(
&self,
config: Option<&ClientConfig>,
request: Request
) -> Result<Response, Error>
[src]
&self,
config: Option<&ClientConfig>,
request: Request
) -> Result<Response, Error>
fn config(&self) -> &ClientConfig
[src]
fn config_mut(&mut self) -> &mut ClientConfig
[src]
fn get<'cl, U: IntoUrl>(&'cl self, url: U) -> RequestBuilder<'cl, Self>
[src]
fn post<'cl, U: IntoUrl>(&'cl self, url: U) -> RequestBuilder<'cl, Self>
[src]
fn put<'cl, U: IntoUrl>(&'cl self, url: U) -> RequestBuilder<'cl, Self>
[src]
fn patch<'cl, U: IntoUrl>(&'cl self, url: U) -> RequestBuilder<'cl, Self>
[src]
fn delete<'cl, U: IntoUrl>(&'cl self, url: U) -> RequestBuilder<'cl, Self>
[src]
fn head<'cl, U: IntoUrl>(&'cl self, url: U) -> RequestBuilder<'cl, Self>
[src]
fn request<'cl, U: IntoUrl>(
&'cl self,
method: Method,
url: U
) -> RequestBuilder<'cl, Self>
[src]
&'cl self,
method: Method,
url: U
) -> RequestBuilder<'cl, Self>
impl From<DirectClient> for GenericClient
[src]
fn from(c: DirectClient) -> Self
[src]
impl From<ReplayClient> for GenericClient
[src]
fn from(c: ReplayClient) -> Self
[src]
impl From<StubClient> for GenericClient
[src]
fn from(c: StubClient) -> Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for GenericClient
impl Send for GenericClient
impl Sync for GenericClient
impl Unpin for GenericClient
impl UnwindSafe for GenericClient
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,