pub struct MatchContext { /* private fields */ }Expand description
Context for Benchmark::try_match.
This is used to create matching Scores via Self::success and Self::fail.
Users can test their Benchmark::try_match implementations using Self::test.
Internally, the MatchContext decides whether or not failure reasons are evaluated,
eliding formatting in situations where the results will not be used.
Implementations§
Source§impl MatchContext
impl MatchContext
Sourcepub fn success(&self, score: u32) -> Score
pub fn success(&self, score: u32) -> Score
Create a new Score configured for “success” with the given score.
Lower scores indicate better successful matches.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MatchContext
impl RefUnwindSafe for MatchContext
impl Send for MatchContext
impl Sync for MatchContext
impl Unpin for MatchContext
impl UnsafeUnpin for MatchContext
impl UnwindSafe for MatchContext
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