#[non_exhaustive]pub struct SoftMatchError {
pub errors: Vec<MatchError>,
}Available on crate feature
std only.Expand description
Error returned by SoftErrors::finish when assertions failed.
Contains all MatchErrors that were collected during the soft
assertion block. The Display output numbers each
failure for easy identification in test output.
§Examples
use behave::prelude::*;
let mut errors = SoftErrors::new();
errors.check(expect!(1).to_equal(99));
let result = errors.finish();
assert!(result.is_err());
let msg = result.err().map(|e| e.to_string()).unwrap_or_default();
assert!(msg.contains("1 soft assertion failed"));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.errors: Vec<MatchError>The collected match errors.
Trait Implementations§
Source§impl Debug for SoftMatchError
impl Debug for SoftMatchError
Source§impl Display for SoftMatchError
impl Display for SoftMatchError
Source§impl Error for SoftMatchError
impl Error for SoftMatchError
1.30.0 · 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 SoftMatchError
impl RefUnwindSafe for SoftMatchError
impl Send for SoftMatchError
impl Sync for SoftMatchError
impl Unpin for SoftMatchError
impl UnsafeUnpin for SoftMatchError
impl UnwindSafe for SoftMatchError
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