[][src]Struct misskey_http::HttpClientBuilder

pub struct HttpClientBuilder { /* fields omitted */ }

Builder for HttpClient.

Implementations

impl HttpClientBuilder[src]

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

Creates a new builder instance with url.

All configurations are set to default.

pub fn with_host<S>(host: S) -> Self 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) -> Self where
    K: TryInto<HeaderName>,
    V: TryInto<HeaderValue>,
    K::Error: Into<Error>,
    V::Error: Into<Error>, 
[src]

Sets an additional header for all requests.

pub fn token<S>(self, token: S) -> Self 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, 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> WithSubscriber for T[src]