[][src]Struct misskey::http::HttpClientBuilder

pub struct HttpClientBuilder { /* fields omitted */ }
This is supported on crate feature http-client only.

Builder for HttpClient.

Implementations

impl HttpClientBuilder[src]

pub fn new<T>(url: T) -> HttpClientBuilder where
    T: TryInto<Url>,
    <T as TryInto<Url>>::Error: Into<Error>, 
[src]

Creates a new builder instance with url.

All configurations are set to default.

pub fn with_host<S>(host: S) -> HttpClientBuilder where
    S: AsRef<str>, 
[src]

Creates a new builder instance with the given host name host.

This method configures the builder with a URL of the form https://{host}/api/. All other configurations are set to default.

pub fn header<K, V>(self, key: K, value: V) -> HttpClientBuilder where
    K: TryInto<HeaderName>,
    V: TryInto<HeaderValue>,
    <K as TryInto<HeaderName>>::Error: Into<Error>,
    <V as TryInto<HeaderValue>>::Error: Into<Error>, 
[src]

Sets an additional header for all requests.

pub fn token<S>(self, token: S) -> HttpClientBuilder where
    S: Into<String>, 
[src]

Sets an API token.

pub fn build(self) -> Result<HttpClient, Error>[src]

Finish this builder instance and build HttpClient.

Trait Implementations

impl Debug for HttpClientBuilder[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> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

impl<T> WithSubscriber for T[src]