Struct twilight_http::client::ClientBuilder[][src]

pub struct ClientBuilder { /* fields omitted */ }
Expand description

A builder for Client.

Implementations

Create a new builder to create a Client.

Build the Client.

Set the ApplicationId used by interaction methods.

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", 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 ratelimiter 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.

Set the token to use for HTTP requests.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.