Struct twilight_http::client::ClientBuilder
source · [−]pub struct ClientBuilder { /* private fields */ }
Expand description
A builder for Client
.
Implementations
Set the default allowed mentions setting to use on all messages sent through the HTTP client.
Set the proxy to use for all HTTP(S) requests.
Note that this isn’t currently a traditional proxy, but is for working with something like twilight’s HTTP proxy server.
Examples
Set the proxy to twilight_http_proxy.internal
:
use twilight_http::Client;
let client = Client::builder()
.proxy("twilight_http_proxy.internal".to_owned(), true)
.build();
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 InMemoryRatelimiter
will be
created by ClientBuilder::build
.
Set the timeout for HTTP requests.
The default is 10 seconds.
Set a group headers which are sent in every request.
Whether to remember whether the client has encountered an Unauthorized response status.
If the client remembers encountering an Unauthorized response, then it will not process future requests.
Defaults to true.
Trait Implementations
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
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more