pub struct TransportConfig {
pub timeout: Duration,
pub default_headers: HashMap<String, String>,
pub user_agent: String,
}
Expand description
HTTP transport configuration
Fields§
§timeout: Duration
Request timeout duration
default_headers: HashMap<String, String>
Default headers to include with all requests
user_agent: String
User agent string
Implementations§
Source§impl TransportConfig
impl TransportConfig
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the request timeout
Sourcepub fn with_header(self, key: String, value: String) -> Self
pub fn with_header(self, key: String, value: String) -> Self
Adds a default header
Sourcepub fn with_user_agent(self, user_agent: String) -> Self
pub fn with_user_agent(self, user_agent: String) -> Self
Sets the user agent
Trait Implementations§
Source§impl Clone for TransportConfig
impl Clone for TransportConfig
Source§fn clone(&self) -> TransportConfig
fn clone(&self) -> TransportConfig
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 TransportConfig
impl Debug for TransportConfig
Auto Trait Implementations§
impl Freeze for TransportConfig
impl RefUnwindSafe for TransportConfig
impl Send for TransportConfig
impl Sync for TransportConfig
impl Unpin for TransportConfig
impl UnwindSafe for TransportConfig
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