pub struct Expression<T> {
pub predicate: Predicate,
pub value: T,
}
Expand description
Represents an expected value
associated to a Predicate
to run against
another value
.
An expression is used to build assertions. It is composed of a Predicate
and an expected value
that will be used to create expressive assertion
functions like this one : status(is_between(200, 204))
. In this example we
assert that the actual StatusCode
is Between
a closed Range
.
Fields§
§predicate: Predicate
The Predicate
to apply in an assertion.
value: T
The expected value as part of the Predicate
.
Trait Implementations§
Source§impl<T: Debug> Debug for Expression<T>
impl<T: Debug> Debug for Expression<T>
Source§impl<'de, T> Deserialize<'de> for Expression<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Expression<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: PartialEq> PartialEq for Expression<T>
impl<T: PartialEq> PartialEq for Expression<T>
impl<T: Eq> Eq for Expression<T>
impl<T> StructuralPartialEq for Expression<T>
Auto Trait Implementations§
impl<T> Freeze for Expression<T>where
T: Freeze,
impl<T> RefUnwindSafe for Expression<T>where
T: RefUnwindSafe,
impl<T> Send for Expression<T>where
T: Send,
impl<T> Sync for Expression<T>where
T: Sync,
impl<T> Unpin for Expression<T>where
T: Unpin,
impl<T> UnwindSafe for Expression<T>where
T: 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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.