#[non_exhaustive]pub struct SourceReport {
pub label: String,
pub total: usize,
pub unique: usize,
}Expand description
What one source contributed.
use kevy_cli::backfill_keys::{Source, collect};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
client.request_borrowed(&[b"SADD", b"a", b"1", b"2"])?;
client.request_borrowed(&[b"SADD", b"b", b"2", b"3"])?;
let u = collect(&mut client, &[Source::Index("a".into()), Source::Index("b".into())])?;
let r = &u.sources[0];
assert_eq!((r.label.as_str(), r.total, r.unique), ("index a", 2, 1));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.label: StringHow the source was named on the command line.
use kevy_cli::backfill_keys::{Source, collect};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
client.request_borrowed(&[b"SADD", b"ids", b"1"])?;
let u = collect(&mut client, &[Source::Index("ids".into())])?;
assert_eq!(u.sources[0].label, "index ids");total: usizeNames this source produced.
use kevy_cli::backfill_keys::{Source, collect};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
client.request_borrowed(&[b"RPUSH", b"queue", b"x", b"y", b"z"])?;
let u = collect(&mut client, &[Source::Index("queue".into())])?;
assert_eq!(u.sources[0].total, 3);unique: usizeNames no other source produced. Non-zero means backfilling from any single source would have missed these rows.
use kevy_cli::backfill_keys::{Source, collect};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
client.request_borrowed(&[b"SADD", b"old", b"1", b"2"])?;
client.request_borrowed(&[b"SADD", b"new", b"1", b"2", b"9"])?;
let u = collect(&mut client, &[Source::Index("old".into()), Source::Index("new".into())])?;
assert_eq!(u.sources[0].unique, 0, "the old index alone misses nothing");
assert_eq!(u.sources[1].unique, 1, "only the new one names 9");Trait Implementations§
Source§impl Clone for SourceReport
impl Clone for SourceReport
Source§impl Debug for SourceReport
impl Debug for SourceReport
Source§impl Default for SourceReport
impl Default for SourceReport
impl Eq for SourceReport
Source§impl Hash for SourceReport
impl Hash for SourceReport
Source§impl PartialEq for SourceReport
impl PartialEq for SourceReport
impl StructuralPartialEq for SourceReport
Auto Trait Implementations§
impl Freeze for SourceReport
impl RefUnwindSafe for SourceReport
impl Send for SourceReport
impl Sync for SourceReport
impl Unpin for SourceReport
impl UnsafeUnpin for SourceReport
impl UnwindSafe for SourceReport
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