pub struct RuntimeConfig {
pub response_save_dir: String,
pub response_save_above_bytes: u64,
pub request_concurrency_limit: u64,
pub timeout_connect_s: u64,
pub pool_idle_timeout_s: u64,
pub retry_base_delay_ms: u64,
pub proxy: Option<String>,
pub tls: TlsConfig,
pub log: Vec<String>,
pub defaults: RequestDefaults,
pub host_defaults: HashMap<String, HostDefaults>,
}Fields§
§response_save_dir: String§response_save_above_bytes: u64§request_concurrency_limit: u64§timeout_connect_s: u64§pool_idle_timeout_s: u64§retry_base_delay_ms: u64§proxy: Option<String>§tls: TlsConfig§log: Vec<String>§defaults: RequestDefaults§host_defaults: HashMap<String, HostDefaults>Implementations§
Source§impl RuntimeConfig
impl RuntimeConfig
pub fn new(download_dir: String) -> Self
Sourcepub fn apply_update(&mut self, patch: ConfigPatch) -> bool
pub fn apply_update(&mut self, patch: ConfigPatch) -> bool
Apply a config patch. Returns true if the reqwest::Client needs to be rebuilt.
Sourcepub fn build_client(&self) -> Result<Client, String>
pub fn build_client(&self) -> Result<Client, String>
Build the shared reqwest::Client from the current config.
Sourcepub fn build_client_for_request(
&self,
tls_override: &TlsConfigPartial,
) -> Result<Client, String>
pub fn build_client_for_request( &self, tls_override: &TlsConfigPartial, ) -> Result<Client, String>
Build a one-off reqwest::Client with per-request TLS overrides applied on
top of the current global config. Used when options.tls is provided.
Sourcepub fn resolve(&self, options: &RequestOptions) -> ResolvedOptions
pub fn resolve(&self, options: &RequestOptions) -> ResolvedOptions
Resolve per-request options by merging config defaults with request overrides.
Sourcepub fn merged_headers(
&self,
request_headers: &HashMap<String, Value>,
host: Option<&str>,
) -> Result<HeaderMap, String>
pub fn merged_headers( &self, request_headers: &HashMap<String, Value>, host: Option<&str>, ) -> Result<HeaderMap, String>
Merge global default headers + host-specific headers + per-request headers. Merge order: defaults.headers_for_any_hosts → host_defaults[host] → request headers. Null removes.
Trait Implementations§
Source§impl Clone for RuntimeConfig
impl Clone for RuntimeConfig
Source§fn clone(&self) -> RuntimeConfig
fn clone(&self) -> RuntimeConfig
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<'de> Deserialize<'de> for RuntimeConfig
impl<'de> Deserialize<'de> for RuntimeConfig
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
Auto Trait Implementations§
impl Freeze for RuntimeConfig
impl RefUnwindSafe for RuntimeConfig
impl Send for RuntimeConfig
impl Sync for RuntimeConfig
impl Unpin for RuntimeConfig
impl UnsafeUnpin for RuntimeConfig
impl UnwindSafe for RuntimeConfig
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