pub struct RegulatorEndpointConfig {
pub enabled: bool,
pub port: u16,
pub host: String,
pub mode: RegulatorMode,
pub latency: LatencyConfig,
pub failure_injection: FailureInjectionConfig,
pub enforce_idempotency: bool,
pub max_idempotency_entries: usize,
pub idempotency_ttl_secs: u64,
pub retry_after_secs: u32,
pub off_peak_config: OffPeakConfig,
}Expand description
Configuration for Regulator Endpoint Simulator
Fields§
§enabled: boolWhether this simulator is enabled
port: u16Port to listen on
host: StringHost to bind to
mode: RegulatorModeResponse mode
latency: LatencyConfigLatency configuration
failure_injection: FailureInjectionConfigFailure injection configuration
enforce_idempotency: boolWhether to enforce idempotency
max_idempotency_entries: usizeMaximum submissions to track for idempotency
idempotency_ttl_secs: u64Idempotency entry TTL in seconds
retry_after_secs: u32Retry-After header value in seconds (for rate limiting)
off_peak_config: OffPeakConfigOff-peak hours configuration
Implementations§
Source§impl RegulatorEndpointConfig
impl RegulatorEndpointConfig
pub fn socket_addr(&self) -> String
pub fn with_mode(self, mode: RegulatorMode) -> Self
Sourcepub fn timeout_mode(self, timeout_ms: u64) -> Self
pub fn timeout_mode(self, timeout_ms: u64) -> Self
Configure for timeout simulation
Sourcepub fn reject_mode(self, code: &str, message: &str) -> Self
pub fn reject_mode(self, code: &str, message: &str) -> Self
Configure for rejection simulation
Sourcepub fn intermittent_mode(self, failure_rate: f64) -> Self
pub fn intermittent_mode(self, failure_rate: f64) -> Self
Configure for intermittent failures
Trait Implementations§
Source§impl Clone for RegulatorEndpointConfig
impl Clone for RegulatorEndpointConfig
Source§fn clone(&self) -> RegulatorEndpointConfig
fn clone(&self) -> RegulatorEndpointConfig
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 RegulatorEndpointConfig
impl Debug for RegulatorEndpointConfig
Source§impl Default for RegulatorEndpointConfig
impl Default for RegulatorEndpointConfig
Source§impl<'de> Deserialize<'de> for RegulatorEndpointConfig
impl<'de> Deserialize<'de> for RegulatorEndpointConfig
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 RegulatorEndpointConfig
impl RefUnwindSafe for RegulatorEndpointConfig
impl Send for RegulatorEndpointConfig
impl Sync for RegulatorEndpointConfig
impl Unpin for RegulatorEndpointConfig
impl UnsafeUnpin for RegulatorEndpointConfig
impl UnwindSafe for RegulatorEndpointConfig
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