rs_zero/rest/route.rs
1/// Describes a route registered by a service.
2#[derive(Debug, Clone, PartialEq, Eq)]
3pub struct RouteSpec {
4 /// HTTP method, for example `GET`.
5 pub method: String,
6 /// Route path, for example `/ready`.
7 pub path: String,
8}
9
10impl RouteSpec {
11 /// Creates a route descriptor.
12 pub fn new(method: impl Into<String>, path: impl Into<String>) -> Self {
13 Self {
14 method: method.into(),
15 path: path.into(),
16 }
17 }
18}