pub struct ActualValue<A> { /* private fields */ }
Expand description
Represent an actual value and optional location of a test case in a source code.
Implementations§
Source§impl<A> ActualValue<A>
impl<A> ActualValue<A>
Sourcepub fn new(value: A) -> Self
pub fn new(value: A) -> Self
Creates a new instance of ActualValue
using value
.
Also to create a new instance you can use expect
function or expect!
macro.
Macro is better because it can save location of a test case in a source code.
Sourcepub fn location(self, l: SourceLocation) -> Self
pub fn location(self, l: SourceLocation) -> Self
Sets a new SourceLocation
.
Sourcepub fn to<M, E>(self, matcher: M) -> TestResultwhere
M: Matcher<A, E>,
pub fn to<M, E>(self, matcher: M) -> TestResultwhere
M: Matcher<A, E>,
Performs assertion matching using matcher
. Returns a new instance of TestResult
.
Sourcepub fn to_not<M, E>(self, matcher: M) -> TestResultwhere
M: Matcher<A, E>,
pub fn to_not<M, E>(self, matcher: M) -> TestResultwhere
M: Matcher<A, E>,
Performs negation matching using matcher
. Returns a new instance of TestResult
.
Sourcepub fn not_to<M, E>(self, matcher: M) -> TestResultwhere
M: Matcher<A, E>,
pub fn not_to<M, E>(self, matcher: M) -> TestResultwhere
M: Matcher<A, E>,
Performs negation matching using matcher
. Returns a new instance of TestResult
.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for ActualValue<A>where
A: Freeze,
impl<A> RefUnwindSafe for ActualValue<A>where
A: RefUnwindSafe,
impl<A> Send for ActualValue<A>where
A: Send,
impl<A> Sync for ActualValue<A>where
A: Sync,
impl<A> Unpin for ActualValue<A>where
A: Unpin,
impl<A> UnwindSafe for ActualValue<A>where
A: UnwindSafe,
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