Struct k9::Snap [−][src]
pub struct Snap(_);
Expand description
String with concurrent access. Allows mutation without &mut reference to itself. It makes passing it to different parts of tests easier when performance is not important. Useful for accumulating output from a system under test and later using it with assert_matches_inline_snapshot.
let snap = k9::Snap::new();
let closure_captured_snap_by_ref = || {
snap.push("a");
};
closure_captured_snap_by_ref();
closure_captured_snap_by_ref();
closure_captured_snap_by_ref();
k9::snapshot!(snap.to_string(), "aaa");
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Snap
impl UnwindSafe for Snap
Blanket Implementations
Mutably borrows from an owned value. Read more