Struct galvanic_assert::MatchResultBuilder
[−]
[src]
pub struct MatchResultBuilder { /* fields omitted */ }
A builder for creating MatchResult
s.
Create a new builder with new()
or for_()
and finalize it either with matched()
, failed_because()
, or failed_comparison()
.
Methods
impl MatchResultBuilder
[src]
fn new() -> MatchResultBuilder
Creates a MatchResultBuilder
for an anonymous Matcher
.
fn for_(name: &str) -> MatchResultBuilder
Creates MatchResultBuilder
for a Matcher
with the given name
fn matched(self) -> MatchResult
Finalzes the builder indicating that the Matcher
matched the inspected value.
fn failed_because(self, reason: &str) -> MatchResult
Finalzes the builder indicating that the Matcher
failed to the inspected value.
The reason
should give a short indication why the matcher failed.
fn failed_comparison<T: Debug>(self, actual: &T, expected: &T) -> MatchResult
Finalzes the builder indicating that the Matcher
failed to the inspected value.
The actual
and expected
value are used the generate a useful error message.