pub struct BpiClientBuilder { /* private fields */ }Expand description
在构造前配置 BpiClient。
Implementations§
Source§impl BpiClientBuilder
impl BpiClientBuilder
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
设置 TCP 连接超时时间。
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
设置 BpiClient::get 和 BpiClient::post 使用的默认 user-agent。
Sourcepub fn referer(self, referer: impl Into<String>) -> Self
pub fn referer(self, referer: impl Into<String>) -> Self
设置 BpiClient::get 和 BpiClient::post 使用的默认 referer 请求头。
Sourcepub fn origin(self, origin: impl Into<String>) -> Self
pub fn origin(self, origin: impl Into<String>) -> Self
设置 BpiClient::get 和 BpiClient::post 使用的默认 origin 请求头。
Sourcepub fn reqwest_client(self, client: Client) -> Self
pub fn reqwest_client(self, client: Client) -> Self
使用外部配置的 reqwest client。
Trait Implementations§
Source§impl Debug for BpiClientBuilder
impl Debug for BpiClientBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for BpiClientBuilder
impl !UnwindSafe for BpiClientBuilder
impl Freeze for BpiClientBuilder
impl Send for BpiClientBuilder
impl Sync for BpiClientBuilder
impl Unpin for BpiClientBuilder
impl UnsafeUnpin for BpiClientBuilder
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