#[non_exhaustive]pub enum OnErrorReply {
Count,
Abort,
}Expand description
What an import does when the server answers a command with an error.
use kevy_cli::migrate::OnErrorReply;
// `import --strict`
assert_ne!(OnErrorReply::Abort, OnErrorReply::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.
Count
Count it in ImportReport::errors and carry on.
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), "counted, and the import went on");Abort
Stop with an InvalidData error naming the reply (--strict).
use kevy_cli::migrate::{ImportStart, OnErrorReply, run_import};
let mut client = kevy_resp_client::RespClient::connect("127.0.0.1", port)?;
let err = run_import(&mut client, &src, ImportStart::Fresh, OnErrorReply::Abort).unwrap_err();
assert_eq!(err.kind(), std::io::ErrorKind::InvalidData);
assert!(err.to_string().starts_with("server error (strict)"));Trait Implementations§
Source§impl Clone for OnErrorReply
impl Clone for OnErrorReply
impl Copy for OnErrorReply
Source§impl Debug for OnErrorReply
impl Debug for OnErrorReply
Source§impl Default for OnErrorReply
impl Default for OnErrorReply
impl Eq for OnErrorReply
Source§impl Hash for OnErrorReply
impl Hash for OnErrorReply
Source§impl PartialEq for OnErrorReply
impl PartialEq for OnErrorReply
impl StructuralPartialEq for OnErrorReply
Auto Trait Implementations§
impl Freeze for OnErrorReply
impl RefUnwindSafe for OnErrorReply
impl Send for OnErrorReply
impl Sync for OnErrorReply
impl Unpin for OnErrorReply
impl UnsafeUnpin for OnErrorReply
impl UnwindSafe for OnErrorReply
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