pub struct ProxyConfig {
pub health_check_url: String,
pub health_check_interval: Duration,
pub health_check_timeout: Duration,
pub circuit_open_threshold: u32,
pub circuit_half_open_after: Duration,
pub sticky_policy: StickyPolicy,
}Expand description
Configuration governing health checking and circuit-breaker behaviour.
Duration fields serialize as integer seconds for TOML/JSON compatibility.
§Example
use stygian_proxy::types::ProxyConfig;
use std::time::Duration;
let cfg = ProxyConfig::default();
assert_eq!(cfg.health_check_url, "https://httpbin.org/ip");
assert_eq!(cfg.health_check_interval, Duration::from_secs(60));
assert_eq!(cfg.health_check_timeout, Duration::from_secs(5));
assert_eq!(cfg.circuit_open_threshold, 5);
assert_eq!(cfg.circuit_half_open_after, Duration::from_secs(30));Fields§
§health_check_url: StringURL called during health checks to verify proxy liveness.
health_check_interval: DurationHow often to run health checks (seconds).
health_check_timeout: DurationPer-probe HTTP timeout (seconds).
circuit_open_threshold: u32Consecutive failures before the circuit trips to OPEN.
circuit_half_open_after: DurationHow long to wait in OPEN before transitioning to HALF-OPEN (seconds).
sticky_policy: StickyPolicySticky-session policy for domain→proxy binding.
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
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 ProxyConfig
impl Debug for ProxyConfig
Source§impl Default for ProxyConfig
impl Default for ProxyConfig
Source§impl<'de> Deserialize<'de> for ProxyConfig
impl<'de> Deserialize<'de> for ProxyConfig
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 ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnsafeUnpin for ProxyConfig
impl UnwindSafe for ProxyConfig
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