pub struct HttpChaosProfile {
pub error_status: Option<u16>,
pub error_probability: Option<f64>,
pub latency: Option<Delay>,
pub connection_drop: Option<bool>,
pub seed: Option<i64>,
pub extra: HashMap<String, Value>,
}Expand description
An HTTP chaos / fault-injection profile for a host or expectation. Maps to
the HttpChaosProfile schema. Captures the commonly-used fields; the model
carries an extra map for any additional server-supported keys.
Fields§
§error_status: Option<u16>HTTP error status code to return instead of the real response.
error_probability: Option<f64>Probability (0.0–1.0) that a request triggers the error.
latency: Option<Delay>Injected latency (a Delay).
connection_drop: Option<bool>When true, drops the TCP connection without responding.
seed: Option<i64>Fixed seed for deterministic probabilistic outcomes.
extra: HashMap<String, Value>Any additional fields the server supports that are not modelled above.
Implementations§
Source§impl HttpChaosProfile
impl HttpChaosProfile
Sourcepub fn error_status(self, status: u16) -> Self
pub fn error_status(self, status: u16) -> Self
Set the error status code returned on fault.
Sourcepub fn error_probability(self, probability: f64) -> Self
pub fn error_probability(self, probability: f64) -> Self
Set the probability (0.0–1.0) of triggering the error.
Sourcepub fn connection_drop(self, drop: bool) -> Self
pub fn connection_drop(self, drop: bool) -> Self
Drop the TCP connection without responding.
Trait Implementations§
Source§impl Clone for HttpChaosProfile
impl Clone for HttpChaosProfile
Source§fn clone(&self) -> HttpChaosProfile
fn clone(&self) -> HttpChaosProfile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HttpChaosProfile
impl Debug for HttpChaosProfile
Source§impl Default for HttpChaosProfile
impl Default for HttpChaosProfile
Source§fn default() -> HttpChaosProfile
fn default() -> HttpChaosProfile
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HttpChaosProfile
impl<'de> Deserialize<'de> for HttpChaosProfile
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
Source§impl PartialEq for HttpChaosProfile
impl PartialEq for HttpChaosProfile
Source§fn eq(&self, other: &HttpChaosProfile) -> bool
fn eq(&self, other: &HttpChaosProfile) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for HttpChaosProfile
impl Serialize for HttpChaosProfile
impl StructuralPartialEq for HttpChaosProfile
Auto Trait Implementations§
impl Freeze for HttpChaosProfile
impl RefUnwindSafe for HttpChaosProfile
impl Send for HttpChaosProfile
impl Sync for HttpChaosProfile
impl Unpin for HttpChaosProfile
impl UnsafeUnpin for HttpChaosProfile
impl UnwindSafe for HttpChaosProfile
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