pub struct Divergence {
pub status: Option<(u16, u16)>,
pub headers: Option<HeaderDiff>,
pub body: Option<BodyDiff>,
}Expand description
Per-field divergence summary. None = no diff or field was ignored.
Fields§
§status: Option<(u16, u16)>Some((primary, shadow)) when the status codes differ.
headers: Option<HeaderDiff>Some((added, removed, changed)) header keys.
body: Option<BodyDiff>Some((primary_len, shadow_len, prefix_equal_bytes)) when bodies differ.
Implementations§
Source§impl Divergence
impl Divergence
Sourcepub fn compare(
primary: &ResponseRecord,
shadow: &ResponseRecord,
config: &ShadowConfig,
) -> Option<Self>
pub fn compare( primary: &ResponseRecord, shadow: &ResponseRecord, config: &ShadowConfig, ) -> Option<Self>
Compute a Divergence from two records given the config’s ignore list.
Returns None when every diffed field matches.
Trait Implementations§
Source§impl Clone for Divergence
impl Clone for Divergence
Source§fn clone(&self) -> Divergence
fn clone(&self) -> Divergence
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 Divergence
impl Debug for Divergence
Source§impl PartialEq for Divergence
impl PartialEq for Divergence
Source§fn eq(&self, other: &Divergence) -> bool
fn eq(&self, other: &Divergence) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for Divergence
impl StructuralPartialEq for Divergence
Auto Trait Implementations§
impl Freeze for Divergence
impl RefUnwindSafe for Divergence
impl Send for Divergence
impl Sync for Divergence
impl Unpin for Divergence
impl UnsafeUnpin for Divergence
impl UnwindSafe for Divergence
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