Struct discord_flows::http::client::HttpBuilder
source · pub struct HttpBuilder { /* private fields */ }Expand description
A builder for the underlying Http client that performs requests
to Discord’s HTTP API. If you do not need to use a proxy or do not
need to disable the rate limiter, you can use Http::new or
Http::new_with_application_id instead.
Example
Create an instance of Http with a proxy and rate limiter disabled
let http = HttpBuilder::new("token")
.proxy("http://127.0.0.1:3000")
.expect("Invalid proxy URL")
.ratelimiter_disabled(true)
.build();Implementations§
source§impl HttpBuilder
impl HttpBuilder
sourcepub fn new(token: impl AsRef<str>) -> Self
pub fn new(token: impl AsRef<str>) -> Self
Construct a new builder to call methods on for the HTTP construction.
The token will automatically be prefixed “Bot “ if not already.
sourcepub fn application_id(self, application_id: u64) -> Self
pub fn application_id(self, application_id: u64) -> Self
Sets the application_id to use interactions.
Auto Trait Implementations§
impl RefUnwindSafe for HttpBuilder
impl Send for HttpBuilder
impl Sync for HttpBuilder
impl Unpin for HttpBuilder
impl UnwindSafe for HttpBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more