[][src]Struct yukikaze::client::Client

pub struct Client<C = DefaultCfg> where
    C: Config + 'static, 
{ /* fields omitted */ }

HTTP Client

Methods

impl<C: Config> Client<C> where
    <C::Connector as Service<Uri>>::Error: Into<Box<dyn Error + Send + Sync + 'static>>,
    <C::Connector as Service<Uri>>::Future: Send + Unpin,
    <C::Connector as Service<Uri>>::Response: AsyncRead + AsyncWrite + Connection + Unpin + Send
[src]

pub fn new() -> Client<C>[src]

Creates new instance of client with specified configuration.

Use Default if you'd like to use default config.

pub async fn request<'_>(&'_ self, __arg1: Request) -> RequestResult[src]

Sends request, and returns response

pub async fn send<'_>(
    &'_ self,
    __arg1: Request
) -> Result<RequestResult, Expired<impl Future<Output = RequestResult>, C::Timer>>
[src]

Sends request and returns response. Timed version.

On timeout error it returns async_timer::Expired as Error Expired implements Future that can be used to re-spawn ongoing request again.

If request resolves in time returns Result<response::Response, hyper::Error> as Ok variant.

pub async fn send_redirect(
    &'static self,
    req: Request
) -> Result<RequestResult, Expired<impl Future<Output = RequestResult> + 'static, C::Timer>>
[src]

Sends request and returns response, while handling redirects. Timed version.

On timeout error it returns async_timer::Expired as Error Expired implements Future that can be used to re-spawn ongoing request again.

If request resolves in time returns Result<response::Response, hyper::Error> as Ok variant.

pub async fn redirect_request<'_>(&'_ self, __arg1: Request) -> RequestResult[src]

Sends request and returns response, while handling redirects.

Trait Implementations

impl Default for Client[src]

fn default() -> Self[src]

Creates Client with default configuration.

impl<C: Config> Debug for Client<C>[src]

Auto Trait Implementations

impl<C> Sync for Client<C> where
    C: Sync,
    <C as Config>::Connector: Sync

impl<C> Send for Client<C> where
    C: Send,
    <C as Config>::Connector: Send

impl<C> Unpin for Client<C> where
    C: Unpin,
    <C as Config>::Connector: Unpin

impl<C = DefaultCfg> !UnwindSafe for Client<C>

impl<C = DefaultCfg> !RefUnwindSafe for Client<C>

Blanket Implementations

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

impl<T> From<T> for 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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self