pub struct FailureReason {
kind: Option<FailureResultKind>,
message: Option<&'static str>,
}Expand description
Reason why a test is expected to fail.
If the test fails for a different reason, the given FailureCase will be ignored.
Fields§
§kind: Option<FailureResultKind>Match a particular kind of failure result.
If None, match any result kind.
message: Option<&'static str>Match a particular message of a failure result.
If None, matches any message. If Some, a case-insensitive sub-string
test is performed. Allowing "error occurred" to match a message like
"An unexpected Error occurred!".
Implementations§
Source§impl FailureReason
impl FailureReason
Sourcepub fn validation_error() -> Self
pub fn validation_error() -> Self
Match a validation error.
Sourcepub fn with_message(self, message: &'static str) -> Self
pub fn with_message(self, message: &'static str) -> Self
Match an error with a message.
If specified, a case-insensitive sub-string test is performed. Allowing
"error occurred" to match a message like "An unexpected Error occurred!".
Trait Implementations§
Source§impl Clone for FailureReason
impl Clone for FailureReason
Source§fn clone(&self) -> FailureReason
fn clone(&self) -> FailureReason
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FailureReason
impl Debug for FailureReason
Source§impl Default for FailureReason
impl Default for FailureReason
Source§fn default() -> FailureReason
fn default() -> FailureReason
Returns the “default value” for a type. Read more
Source§impl PartialEq for FailureReason
impl PartialEq for FailureReason
impl StructuralPartialEq for FailureReason
Auto Trait Implementations§
impl Freeze for FailureReason
impl RefUnwindSafe for FailureReason
impl Send for FailureReason
impl Sync for FailureReason
impl Unpin for FailureReason
impl UnwindSafe for FailureReason
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more