Skip to main content

Context

Struct Context 

Source
pub struct Context {
Show 13 fields pub dns_resolved: Option<bool>, pub dns_error: Option<String>, pub dns_host: Option<String>, pub tls_handshake_ms: Option<u64>, pub tls_handshake_failed: Option<bool>, pub tls_failure_reason: Option<String>, pub tls_peer: Option<String>, pub client_clock_skew_secs: Option<i64>, pub signing_required: Option<bool>, pub signature_tolerance_secs: Option<u64>, pub body_mutated_before_verification: Option<bool>, pub elapsed_ms_before_abort: Option<u64>, pub connection_error: Option<String>,
}
Expand description

Environmental observations from the caller’s own network stack — things that don’t appear in the HTTP transaction itself.

All fields are Option and #[serde(default)] so a fixture only needs to set the ones relevant to its failure mode. Unset fields are “we didn’t observe this,” not “we observed it as zero.”

Fields§

§dns_resolved: Option<bool>

Some(false) means DNS resolution was attempted and failed; Some(true) or None means it either succeeded or wasn’t reached.

§dns_error: Option<String>§dns_host: Option<String>§tls_handshake_ms: Option<u64>

Time spent in TLS handshake on a successful connection.

§tls_handshake_failed: Option<bool>

Some(true) indicates the handshake was attempted and failed.

§tls_failure_reason: Option<String>§tls_peer: Option<String>§client_clock_skew_secs: Option<i64>

Skew between the client’s clock and the server’s, in seconds. Sign indicates direction (negative = client behind server). Absolute value is what gets compared to signature_tolerance_secs.

§signing_required: Option<bool>

Set by webhook-receiver fixtures; toggles whether clock-skew evidence is even meaningful for this case.

§signature_tolerance_secs: Option<u64>

HMAC tolerance window in seconds.

§body_mutated_before_verification: Option<bool>

Set when middleware re-encoded the JSON body between the wire and HMAC verification. Drives the BodyMutatedBeforeVerification evidence variant.

§elapsed_ms_before_abort: Option<u64>

Wall-clock time the client spent waiting before giving up on a non-arriving response.

§connection_error: Option<String>

Free-text error string from the caller’s network stack. Used for rendering only; rules don’t read this directly.

Trait Implementations§

Source§

impl Clone for Context

Source§

fn clone(&self) -> Context

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Context

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Context

Source§

fn default() -> Context

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Context

Source§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,