pub enum SnapshotFailure {
Missing {
path: PathBuf,
},
Mismatch {
path: PathBuf,
expected: String,
actual: String,
},
Io {
path: PathBuf,
action: &'static str,
source: Error,
},
}Expand description
Why a snapshot assertion did not pass.
This is the structured form: test-better-matchers turns it into a
TestError (a Mismatch becomes an
expected/actual payload with a diff), but the failure is described here so
the crate is usable on its own.
Variants§
Missing
No snapshot file exists and the mode was Compare.
Mismatch
The snapshot file exists but its contents differ from actual.
Fields
Io
Resolving the snapshot directory, reading the file, or writing it failed.
Trait Implementations§
Source§impl Debug for SnapshotFailure
impl Debug for SnapshotFailure
Source§impl Display for SnapshotFailure
impl Display for SnapshotFailure
Source§impl Error for SnapshotFailure
impl Error for SnapshotFailure
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for SnapshotFailure
impl !RefUnwindSafe for SnapshotFailure
impl Send for SnapshotFailure
impl Sync for SnapshotFailure
impl Unpin for SnapshotFailure
impl UnsafeUnpin for SnapshotFailure
impl !UnwindSafe for SnapshotFailure
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