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]

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]

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]

Set the URL resolver

Set the URL resolver for this client.

impl<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

impl<C, R> Send for Pretend<C, R> where
    C: Send,
    R: Send

impl<C, R> Sync for Pretend<C, R> where
    C: Sync,
    R: Sync

impl<C, R> Unpin for Pretend<C, R> where
    C: Unpin,
    R: Unpin

impl<C, R> UnwindSafe for Pretend<C, R> where
    C: UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.