pub struct Route {
pub method: Method,
pub path: String,
pub when: Option<RequestMatch>,
pub response: ResponseSpec,
}Expand description
A single mock route.
A route is selected when its HTTP method and path match the request,
and (optionally) the RequestMatch rules in when are satisfied.
Fields§
§method: MethodHTTP method for this route.
path: StringPath pattern, e.g. /users/{id}.
Segments wrapped in curly braces are captured as path parameters.
when: Option<RequestMatch>Optional additional request matching rules.
response: ResponseSpecResponse (single or sequence) produced when the route matches.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Route
impl<'de> Deserialize<'de> for Route
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 StructuralPartialEq for Route
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnsafeUnpin for Route
impl UnwindSafe for Route
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