pub struct HttpConfig {
pub timeout: Duration,
pub connect_timeout: Duration,
pub max_retries: u32,
pub retry_delay: Duration,
}Expand description
HTTP传输层配置
Fields§
§timeout: Duration请求超时时间(默认30秒)
connect_timeout: Duration连接超时时间(默认10秒)
max_retries: u32最大重试次数(默认3次)
retry_delay: Duration重试延迟(默认1秒)
Implementations§
Source§impl HttpConfig
impl HttpConfig
Sourcepub fn builder() -> HttpConfigBuilder<((), (), (), ())>
pub fn builder() -> HttpConfigBuilder<((), (), (), ())>
Create a builder for building HttpConfig.
On the builder, call .timeout(...)(optional), .connect_timeout(...)(optional), .max_retries(...)(optional), .retry_delay(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of HttpConfig.
Trait Implementations§
Source§impl Clone for HttpConfig
impl Clone for HttpConfig
Source§fn clone(&self) -> HttpConfig
fn clone(&self) -> HttpConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpConfig
impl Debug for HttpConfig
Auto Trait Implementations§
impl Freeze for HttpConfig
impl RefUnwindSafe for HttpConfig
impl Send for HttpConfig
impl Sync for HttpConfig
impl Unpin for HttpConfig
impl UnwindSafe for HttpConfig
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