pub struct SlackClientBuilder { /* private fields */ }Expand description
Builder for SlackClient.
Implementations§
Source§impl SlackClientBuilder
impl SlackClientBuilder
pub fn token(self, token: impl Into<String>) -> Self
Sourcepub fn http_client(self, http: Client) -> Self
pub fn http_client(self, http: Client) -> Self
Uses an existing reqwest::Client so the application and Slack share one connection pool.
Defaults to reqwest::Client::default().
Sourcepub fn base_url(self, base_url: impl Into<String>) -> Self
pub fn base_url(self, base_url: impl Into<String>) -> Self
Base URL of the API (default https://slack.com/api/). Set it for GovSlack
(https://slack-gov.com/api/) or for a mock server in tests.
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
How many times a request is resent after a 429, waiting for Retry-After each time
(default 3, 0 disables retries).
Other failures (5xx, network errors) are never retried, to avoid posting twice.
pub fn build(self) -> SlackClient
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SlackClientBuilder
impl !UnwindSafe for SlackClientBuilder
impl Freeze for SlackClientBuilder
impl Send for SlackClientBuilder
impl Sync for SlackClientBuilder
impl Unpin for SlackClientBuilder
impl UnsafeUnpin for SlackClientBuilder
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