Struct pretend::Pretend [−][src]
pub struct Pretend<C, R> where
R: ResolveUrl, { /* fields omitted */ }
Expand description
The pretend HTTP client
This struct is the entry point for pretend
clients. It can be constructed with
an HTTP client implementation, and pretend
annotated traits will automatically
be implemented by this struct.
See crate level documentation for more information
Implementations
impl<C, R> Pretend<C, R> where
R: ResolveUrl,
[src]
impl<C, R> Pretend<C, R> where
R: ResolveUrl,
[src]pub fn new(client: C, resolver: R) -> Pretend<C, R>
[src]
pub fn new(client: C, resolver: R) -> Pretend<C, R>
[src]Constructor
This constructor takes a client implementation and an URL resolver.
Prefer using Pretend::for_client
and Pretend::with_url
.
pub fn with_url(self, url: Url) -> Pretend<C, UrlResolver>
[src]
pub fn with_url(self, url: Url) -> Pretend<C, UrlResolver>
[src]Set the base URL
Set the base URL for this client.
pub fn with_url_resolver<RR>(self, resolver: RR) -> Pretend<C, RR> where
RR: ResolveUrl,
[src]
pub fn with_url_resolver<RR>(self, resolver: RR) -> Pretend<C, RR> where
RR: ResolveUrl,
[src]Set the URL resolver
Set the URL resolver for this client.
impl<C> Pretend<C, InvalidUrlResolver>
[src]
impl<C> Pretend<C, InvalidUrlResolver>
[src]pub fn for_client(client: C) -> Pretend<C, InvalidUrlResolver>
[src]
pub fn for_client(client: C) -> Pretend<C, InvalidUrlResolver>
[src]Constructor
This constructor takes a client implementation and
return an incomplete Pretend
client. Use Pretend::with_url
to
set the base URL.
Auto Trait Implementations
impl<C, R> RefUnwindSafe for Pretend<C, R> where
C: RefUnwindSafe,
R: RefUnwindSafe,
C: RefUnwindSafe,
R: RefUnwindSafe,
impl<C, R> Send for Pretend<C, R> where
C: Send,
R: Send,
C: Send,
R: Send,
impl<C, R> Sync for Pretend<C, R> where
C: Sync,
R: Sync,
C: Sync,
R: Sync,
impl<C, R> Unpin for Pretend<C, R> where
C: Unpin,
R: Unpin,
C: Unpin,
R: Unpin,
impl<C, R> UnwindSafe for Pretend<C, R> where
C: UnwindSafe,
R: UnwindSafe,
C: UnwindSafe,
R: UnwindSafe,