#[non_exhaustive]pub struct ImportReport {
pub sent: u64,
pub errors: u64,
pub offset: u64,
}Expand description
Import stats.
use kevy_cli::migrate::{ImportStart, OnErrorReply, run_import};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
let r = run_import(&mut client, &src, ImportStart::Fresh, OnErrorReply::Count)?;
assert_eq!((r.sent, r.errors), (2, 1));
assert_eq!(r.offset, std::fs::metadata(&src)?.len());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.sent: u64Commands sent successfully.
use kevy_cli::migrate::{ImportStart, OnErrorReply, run_import};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
assert_eq!(run_import(&mut client, &src, ImportStart::Fresh, OnErrorReply::Count)?.sent, 2);errors: u64-ERR replies (counted; fatal under OnErrorReply::Abort).
use kevy_cli::migrate::{ImportStart, OnErrorReply, run_import};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
let r = run_import(&mut client, &src, ImportStart::Fresh, OnErrorReply::Count)?;
assert_eq!(r.errors, 1, "INCR on a non-number");offset: u64Byte offset reached in the source file.
use kevy_cli::migrate::{ImportStart, OnErrorReply, run_import};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
let r = run_import(&mut client, &src, ImportStart::Fresh, OnErrorReply::Count)?;
// the whole file was applied, and `<src>.progress` says so for a later --resume
assert_eq!(r.offset, std::fs::metadata(&src)?.len());
let progress = std::fs::read_to_string(dir.path().join("cmds.resp.progress"))?;
assert_eq!(progress, r.offset.to_string());Trait Implementations§
Source§impl Clone for ImportReport
impl Clone for ImportReport
Source§impl Debug for ImportReport
impl Debug for ImportReport
Source§impl Default for ImportReport
impl Default for ImportReport
impl Eq for ImportReport
Source§impl Hash for ImportReport
impl Hash for ImportReport
Source§impl PartialEq for ImportReport
impl PartialEq for ImportReport
impl StructuralPartialEq for ImportReport
Auto Trait Implementations§
impl Freeze for ImportReport
impl RefUnwindSafe for ImportReport
impl Send for ImportReport
impl Sync for ImportReport
impl Unpin for ImportReport
impl UnsafeUnpin for ImportReport
impl UnwindSafe for ImportReport
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