#[non_exhaustive]pub enum Expectation {
Equals(Value),
Regex(String),
Contains(String),
StartsWith(String),
EndsWith(String),
Exists,
JsonSubset(Value),
Any,
}Expand description
A validation expectation. The grammar keys mirror the mock-testkit
matcher rules: equals, regex, contains, startsWith,
endsWith, exists, jsonSubset.
Grammar (dual, value-style): a bare value is a literal
equals; an object with exactly one recognized matcher key is that
matcher (this reading takes precedence over the literal one); any
other object — zero, multiple, or unrecognized keys — is a literal
equals compared structurally. regex patterns are
compile-verified at load time, matching the unit-tier matcher
rules.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Equals(Value)
Exact equality against the value.
Regex(String)
Regular expression match, compile-verified at load time.
Contains(String)
Substring containment.
StartsWith(String)
Prefix match.
EndsWith(String)
Suffix match.
Exists
The value under validation is present.
JsonSubset(Value)
Recursive-subset match against an object.
Any
Matches any value including null; the wildcard verb (ignore
at the grammar layer, the Citrus @ignore@ equivalent).
Trait Implementations§
Source§impl Clone for Expectation
impl Clone for Expectation
Source§fn clone(&self) -> Expectation
fn clone(&self) -> Expectation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more