[−][src]Struct misskey_http::HttpClientBuilder
Builder for HttpClient
.
Implementations
impl HttpClientBuilder
[src]
pub fn new<T>(url: T) -> Self where
T: TryInto<Url>,
T::Error: Into<Error>,
[src]
T: TryInto<Url>,
T::Error: Into<Error>,
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]
S: AsRef<str>,
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]
K: TryInto<HeaderName>,
V: TryInto<HeaderValue>,
K::Error: Into<Error>,
V::Error: Into<Error>,
Sets an additional header for all requests.
pub fn token<S>(self, token: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Sets an API token.
pub fn build(self) -> Result<HttpClient, Error>
[src]
Finish this builder instance and build HttpClient
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for HttpClientBuilder
[src]
impl Send for HttpClientBuilder
[src]
impl Sync for HttpClientBuilder
[src]
impl Unpin for HttpClientBuilder
[src]
impl !UnwindSafe for HttpClientBuilder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,