pub struct HttpProfile {
pub req_method: String,
pub endpoint: String,
pub req_timeout: u64,
pub connect_timeout: u64,
pub keep_alive: bool,
pub proxy_host: Option<String>,
pub proxy_port: Option<u16>,
pub user_agent: String,
}
Expand description
HTTP configuration profile
Fields§
§req_method: String
HTTP request method (GET, POST)
endpoint: String
API endpoint URL
req_timeout: u64
Request timeout in seconds
connect_timeout: u64
Connection timeout in seconds
keep_alive: bool
Keep-alive setting
proxy_host: Option<String>
Proxy host (optional)
proxy_port: Option<u16>
Proxy port (optional)
user_agent: String
User-Agent header
Implementations§
Source§impl HttpProfile
impl HttpProfile
Sourcepub fn set_req_method<S: Into<String>>(&mut self, method: S) -> &mut Self
pub fn set_req_method<S: Into<String>>(&mut self, method: S) -> &mut Self
Set the HTTP request method
Sourcepub fn set_endpoint<S: Into<String>>(&mut self, endpoint: S) -> &mut Self
pub fn set_endpoint<S: Into<String>>(&mut self, endpoint: S) -> &mut Self
Set the API endpoint
Sourcepub fn set_req_timeout(&mut self, timeout: u64) -> &mut Self
pub fn set_req_timeout(&mut self, timeout: u64) -> &mut Self
Set the request timeout in seconds
Sourcepub fn set_connect_timeout(&mut self, timeout: u64) -> &mut Self
pub fn set_connect_timeout(&mut self, timeout: u64) -> &mut Self
Set the connection timeout in seconds
Sourcepub fn set_keep_alive(&mut self, keep_alive: bool) -> &mut Self
pub fn set_keep_alive(&mut self, keep_alive: bool) -> &mut Self
Set the keep-alive setting
Sourcepub fn set_proxy_host<S: Into<String>>(&mut self, host: Option<S>) -> &mut Self
pub fn set_proxy_host<S: Into<String>>(&mut self, host: Option<S>) -> &mut Self
Set the proxy host
Sourcepub fn set_proxy_port(&mut self, port: Option<u16>) -> &mut Self
pub fn set_proxy_port(&mut self, port: Option<u16>) -> &mut Self
Set the proxy port
Sourcepub fn set_user_agent<S: Into<String>>(&mut self, user_agent: S) -> &mut Self
pub fn set_user_agent<S: Into<String>>(&mut self, user_agent: S) -> &mut Self
Set the User-Agent header
Sourcepub fn get_full_endpoint(&self) -> String
pub fn get_full_endpoint(&self) -> String
Get the full endpoint URL with protocol
Sourcepub fn get_req_timeout(&self) -> Duration
pub fn get_req_timeout(&self) -> Duration
Get request timeout as Duration
Sourcepub fn get_connect_timeout(&self) -> Duration
pub fn get_connect_timeout(&self) -> Duration
Get connection timeout as Duration
Sourcepub fn get_proxy_url(&self) -> Option<String>
pub fn get_proxy_url(&self) -> Option<String>
Get proxy URL if configured
Trait Implementations§
Source§impl Clone for HttpProfile
impl Clone for HttpProfile
Source§fn clone(&self) -> HttpProfile
fn clone(&self) -> HttpProfile
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 HttpProfile
impl Debug for HttpProfile
Auto Trait Implementations§
impl Freeze for HttpProfile
impl RefUnwindSafe for HttpProfile
impl Send for HttpProfile
impl Sync for HttpProfile
impl Unpin for HttpProfile
impl UnwindSafe for HttpProfile
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