[−][src]Struct twilight_http::client::ClientBuilder
A builder for Client
.
Implementations
impl ClientBuilder
[src]
pub fn new() -> Self
[src]
Create a new builder to create a Client
.
pub fn build(self) -> Result<Client>
[src]
pub fn default_allowed_mentions(
&mut self,
allowed_mentions: AllowedMentions
) -> &mut Self
[src]
&mut self,
allowed_mentions: AllowedMentions
) -> &mut Self
Set the default allowed mentions setting to use on all messages sent through the HTTP client.
pub fn proxy(&mut self, proxy: Proxy) -> &mut Self
[src]
Sets the proxy to use for all HTTP requests.
This accepts a reqwest::Proxy
.
pub fn proxy_http(&mut self, proxy_http: bool) -> &mut Self
[src]
Set whether to proxy over HTTP.
The default is false
.
pub fn reqwest_client(&mut self, client: ReqwestClient) -> &mut Self
[src]
Set the reqwest client to use.
All of the settings in the client will be overwritten by the settings in this configuration, if specified.
The default client is a RusTLS-backed client.
pub fn ratelimiter(
&mut self,
ratelimiter: impl Into<Option<Ratelimiter>>
) -> &mut Self
[src]
&mut self,
ratelimiter: impl Into<Option<Ratelimiter>>
) -> &mut Self
Set a ratelimiter to use.
If the argument is None
then the client's ratelimiter will be skipped
before making a request.
If this method is not called at all then a default ratelimiter will be
created by ClientBuilder::build
.
pub fn timeout(&mut self, duration: Duration) -> &mut Self
[src]
Set the timeout for HTTP requests.
The default is 10 seconds.
pub fn token(&mut self, token: impl Into<String>) -> &mut Self
[src]
Set the token to use for HTTP requests.
Trait Implementations
impl Clone for ClientBuilder
[src]
fn clone(&self) -> ClientBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ClientBuilder
[src]
impl Default for ClientBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,