pub struct RequestMatch {
pub query: HashMap<String, String>,
pub headers: HashMap<String, String>,
pub body: Option<Value>,
}Expand description
Rules used to decide whether a Route matches an incoming request.
All fields are optional; an empty RequestMatch matches every request.
Header matching is performed case-insensitively by the router.
Fields§
§query: HashMap<String, String>Query parameters that must be present with the given value.
headers: HashMap<String, String>Request headers that must be present with the given value.
Matched case-insensitively.
body: Option<Value>A JSON value that must be a subset of the request body.
Subset matching means: every field of a JSON object in body must be
present (and equal) in the request body. Arrays must match element by
element and have the same length. Scalar values use equality.
Trait Implementations§
Source§impl Clone for RequestMatch
impl Clone for RequestMatch
Source§fn clone(&self) -> RequestMatch
fn clone(&self) -> RequestMatch
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 RequestMatch
impl Debug for RequestMatch
Source§impl Default for RequestMatch
impl Default for RequestMatch
Source§fn default() -> RequestMatch
fn default() -> RequestMatch
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RequestMatch
impl<'de> Deserialize<'de> for RequestMatch
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
impl Eq for RequestMatch
Source§impl JsonSchema for RequestMatch
impl JsonSchema for RequestMatch
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for RequestMatch
impl PartialEq for RequestMatch
Source§fn eq(&self, other: &RequestMatch) -> bool
fn eq(&self, other: &RequestMatch) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RequestMatch
impl Serialize for RequestMatch
impl StructuralPartialEq for RequestMatch
Auto Trait Implementations§
impl Freeze for RequestMatch
impl RefUnwindSafe for RequestMatch
impl Send for RequestMatch
impl Sync for RequestMatch
impl Unpin for RequestMatch
impl UnsafeUnpin for RequestMatch
impl UnwindSafe for RequestMatch
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.