#[non_exhaustive]pub struct ShadowReport {
pub samples: u64,
pub diverged: u64,
pub first: Option<(u64, Compared)>,
}Expand description
Outcome of a shadow run — the paste-able conclusion.
use kevy_cli::shadow::{Shape, print_report, run};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
let r = run(&mut client, &argv("ZRANGE feed 0 -1"), &argv("LRANGE feed:new 0 -1"),
Shape::Flat, Shape::Flat, 3)?;
print_report(&r);
assert!(r.diverged > 0);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.samples: u64How many times both sides were asked.
use kevy_cli::shadow::{Shape, run};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
let r = run(&mut client, &argv("ZRANGE feed 0 -1"), &argv("LRANGE feed:new 0 -1"),
Shape::Flat, Shape::Flat, 3)?;
assert_eq!(r.samples, 3);diverged: u64How many of those disagreed in membership or order.
use kevy_cli::shadow::{Shape, run};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
let same = argv("ZRANGE feed 0 -1");
let r = run(&mut client, &same, &same, Shape::Flat, Shape::Flat, 2)?;
assert_eq!(r.diverged, 0, "a path agrees with itself");first: Option<(u64, Compared)>The first sample that disagreed, and how.
use kevy_cli::shadow::{Shape, run};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
let r = run(&mut client, &argv("ZRANGE feed 0 -1"), &argv("LRANGE feed:new 0 -1"),
Shape::Flat, Shape::Flat, 3)?;
let (sample, c) = r.first.expect("diverged");
assert_eq!((sample, c.missing), (0, vec![b"b".to_vec()]));Trait Implementations§
Source§impl Clone for ShadowReport
impl Clone for ShadowReport
Source§impl Debug for ShadowReport
impl Debug for ShadowReport
Source§impl Default for ShadowReport
impl Default for ShadowReport
impl Eq for ShadowReport
Source§impl Hash for ShadowReport
impl Hash for ShadowReport
Source§impl PartialEq for ShadowReport
impl PartialEq for ShadowReport
impl StructuralPartialEq for ShadowReport
Auto Trait Implementations§
impl Freeze for ShadowReport
impl RefUnwindSafe for ShadowReport
impl Send for ShadowReport
impl Sync for ShadowReport
impl Unpin for ShadowReport
impl UnsafeUnpin for ShadowReport
impl UnwindSafe for ShadowReport
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