rs-zero 0.2.6

Rust-first microservice framework inspired by go-zero engineering practices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Describes a route registered by a service.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RouteSpec {
    /// HTTP method, for example `GET`.
    pub method: String,
    /// Route path, for example `/ready`.
    pub path: String,
}

impl RouteSpec {
    /// Creates a route descriptor.
    pub fn new(method: impl Into<String>, path: impl Into<String>) -> Self {
        Self {
            method: method.into(),
            path: path.into(),
        }
    }
}