pub struct HttpConfig {
pub base: DeribitConfig,
pub pool_size: Option<usize>,
pub keep_alive: Option<u64>,
pub http2: bool,
pub gzip: bool,
}Expand description
HTTP client configuration
Fields§
§base: DeribitConfigBase configuration
pool_size: Option<usize>Connection pool size
keep_alive: Option<u64>Keep alive timeout
http2: boolEnable HTTP/2
gzip: boolEnable gzip compression
Implementations§
Source§impl HttpConfig
impl HttpConfig
Sourcepub fn new(base: DeribitConfig) -> Self
pub fn new(base: DeribitConfig) -> Self
Create new HTTP configuration
Sourcepub fn with_pool_size(self, pool_size: usize) -> Self
pub fn with_pool_size(self, pool_size: usize) -> Self
Set connection pool size
Sourcepub fn with_keep_alive(self, keep_alive: u64) -> Self
pub fn with_keep_alive(self, keep_alive: u64) -> Self
Set keep alive timeout
Sourcepub fn with_http2(self, http2: bool) -> Self
pub fn with_http2(self, http2: bool) -> Self
Enable/disable HTTP/2
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
Source§impl<'de> Deserialize<'de> for HttpConfig
impl<'de> Deserialize<'de> for HttpConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for HttpConfig
impl Display 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