pub struct FailureContextCollector;Expand description
Collector for failure context
Implementations§
Source§impl FailureContextCollector
impl FailureContextCollector
Sourcepub fn new() -> FailureContextCollector
pub fn new() -> FailureContextCollector
Create a new failure context collector
Sourcepub fn collect_context(
&self,
method: &str,
path: &str,
status_code: Option<u16>,
error_message: Option<String>,
) -> Result<FailureContext, Error>
pub fn collect_context( &self, method: &str, path: &str, status_code: Option<u16>, error_message: Option<String>, ) -> Result<FailureContext, Error>
Collect failure context from request execution details.
This method builds a normalized context object from the provided request/response inputs with safe defaults for optional integrations.
Sourcepub fn collect_context_with_details(
&self,
method: &str,
path: &str,
headers: HashMap<String, String>,
query_params: HashMap<String, String>,
body: Option<Value>,
status_code: Option<u16>,
response_headers: HashMap<String, String>,
response_body: Option<Value>,
duration_ms: Option<u64>,
error_message: Option<String>,
chaos_configs: Vec<ChaosConfigInfo>,
consistency_rules: Vec<ConsistencyRuleInfo>,
contract_validation: Option<ContractValidationInfo>,
behavioral_rules: Vec<BehavioralRuleInfo>,
hook_results: Vec<HookExecutionInfo>,
) -> Result<FailureContext, Error>
pub fn collect_context_with_details( &self, method: &str, path: &str, headers: HashMap<String, String>, query_params: HashMap<String, String>, body: Option<Value>, status_code: Option<u16>, response_headers: HashMap<String, String>, response_body: Option<Value>, duration_ms: Option<u64>, error_message: Option<String>, chaos_configs: Vec<ChaosConfigInfo>, consistency_rules: Vec<ConsistencyRuleInfo>, contract_validation: Option<ContractValidationInfo>, behavioral_rules: Vec<BehavioralRuleInfo>, hook_results: Vec<HookExecutionInfo>, ) -> Result<FailureContext, Error>
Collect context with additional details
Trait Implementations§
Source§impl Debug for FailureContextCollector
impl Debug for FailureContextCollector
Source§impl Default for FailureContextCollector
impl Default for FailureContextCollector
Source§fn default() -> FailureContextCollector
fn default() -> FailureContextCollector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FailureContextCollector
impl RefUnwindSafe for FailureContextCollector
impl Send for FailureContextCollector
impl Sync for FailureContextCollector
impl Unpin for FailureContextCollector
impl UnsafeUnpin for FailureContextCollector
impl UnwindSafe for FailureContextCollector
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more