pub enum ParameterValues {
Values(Vec<String>),
Matcher(Value),
}Expand description
The value of a single key in a MockServer keyToMultiValue matcher (path parameters, and in general query-string parameters / headers).
MockServer accepts two wire encodings for a key’s value:
- the plain form — a list of exact-or-regex strings (
["42", "^\\d+$"]), modelled byValues; and - the schema-matcher form — a list of matcher objects
(
[{ "schema": { … } }],[{ "not": true, "value": "x" }]), or the{ "parameterStyle": …, "values": [ … ] }object form — captured verbatim byMatcherso no field is dropped on a round-trip.
The enum is #[serde(untagged)]: the plain string-array form deserialises to
Values; anything else (a matcher-object array, an object, or
even a bare string) falls through to Matcher.
Variants§
Values(Vec<String>)
Plain multi-value form: a list of exact-or-regex string values.
Matcher(Value)
Schema / nottable / optional / parameter-style matcher form, kept verbatim.
Implementations§
Trait Implementations§
Source§impl Clone for ParameterValues
impl Clone for ParameterValues
Source§fn clone(&self) -> ParameterValues
fn clone(&self) -> ParameterValues
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParameterValues
impl Debug for ParameterValues
Source§impl<'de> Deserialize<'de> for ParameterValues
impl<'de> Deserialize<'de> for ParameterValues
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 PartialEq for ParameterValues
impl PartialEq for ParameterValues
Source§fn eq(&self, other: &ParameterValues) -> bool
fn eq(&self, other: &ParameterValues) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ParameterValues
impl Serialize for ParameterValues
impl StructuralPartialEq for ParameterValues
Auto Trait Implementations§
impl Freeze for ParameterValues
impl RefUnwindSafe for ParameterValues
impl Send for ParameterValues
impl Sync for ParameterValues
impl Unpin for ParameterValues
impl UnsafeUnpin for ParameterValues
impl UnwindSafe for ParameterValues
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