pub struct GoldenTrace {
pub schema_version: u32,
pub events: Vec<Value>,
}Expand description
Versioned, serializable execution trace for behavioral regression tests.
Fields§
§schema_version: u32Normalization contract version.
events: Vec<Value>Canonical events with generated identities and wall-clock values scrubbed.
Implementations§
Source§impl GoldenTrace
impl GoldenTrace
Sourcepub const SCHEMA_VERSION: u32 = 1
pub const SCHEMA_VERSION: u32 = 1
Current normalization contract version.
Sourcepub fn from_events(events: &[RunEvent]) -> Result<Self, Error>
pub fn from_events(events: &[RunEvent]) -> Result<Self, Error>
Normalizes canonical runtime events for deterministic comparison.
§Errors
Returns serde_json::Error only if a public event cannot be encoded.
Sourcepub fn assert_matches(&self, expected: &Self) -> Result<(), GoldenTraceMismatch>
pub fn assert_matches(&self, expected: &Self) -> Result<(), GoldenTraceMismatch>
Compares two normalized traces and reports the first divergent event.
§Errors
Returns GoldenTraceMismatch for a schema or event difference.
Trait Implementations§
Source§impl Clone for GoldenTrace
impl Clone for GoldenTrace
Source§fn clone(&self) -> GoldenTrace
fn clone(&self) -> GoldenTrace
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 GoldenTrace
impl Debug for GoldenTrace
Source§impl<'de> Deserialize<'de> for GoldenTrace
impl<'de> Deserialize<'de> for GoldenTrace
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 GoldenTrace
impl PartialEq for GoldenTrace
Source§impl Serialize for GoldenTrace
impl Serialize for GoldenTrace
impl StructuralPartialEq for GoldenTrace
Auto Trait Implementations§
impl Freeze for GoldenTrace
impl RefUnwindSafe for GoldenTrace
impl Send for GoldenTrace
impl Sync for GoldenTrace
impl Unpin for GoldenTrace
impl UnsafeUnpin for GoldenTrace
impl UnwindSafe for GoldenTrace
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