#[non_exhaustive]pub enum ImportStart {
Fresh,
Resume,
}Expand description
Where an import starts reading its source file.
use kevy_cli::migrate::ImportStart;
// `import --resume`
assert_ne!(ImportStart::Resume, ImportStart::default());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Fresh
From the first byte, resetting <src>.progress before any batch.
use kevy_cli::migrate::{ImportStart, OnErrorReply, run_import};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
run_import(&mut client, &src, ImportStart::Fresh, OnErrorReply::Count)?;
// fresh ignores any earlier progress and replays the whole file
let again = run_import(&mut client, &src, ImportStart::Fresh, OnErrorReply::Count)?;
assert_eq!(again.sent + again.errors, 3);Resume
From the offset <src>.progress recorded (--resume).
use kevy_cli::migrate::{ImportStart, OnErrorReply, run_import};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
run_import(&mut client, &src, ImportStart::Fresh, OnErrorReply::Count)?;
// resuming a finished import starts at its end and sends nothing
let resumed = run_import(&mut client, &src, ImportStart::Resume, OnErrorReply::Count)?;
assert_eq!(resumed.sent + resumed.errors, 0);Trait Implementations§
Source§impl Clone for ImportStart
impl Clone for ImportStart
impl Copy for ImportStart
Source§impl Debug for ImportStart
impl Debug for ImportStart
Source§impl Default for ImportStart
impl Default for ImportStart
impl Eq for ImportStart
Source§impl Hash for ImportStart
impl Hash for ImportStart
Source§impl PartialEq for ImportStart
impl PartialEq for ImportStart
impl StructuralPartialEq for ImportStart
Auto Trait Implementations§
impl Freeze for ImportStart
impl RefUnwindSafe for ImportStart
impl Send for ImportStart
impl Sync for ImportStart
impl Unpin for ImportStart
impl UnsafeUnpin for ImportStart
impl UnwindSafe for ImportStart
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