ngyn_macros 0.5.0

Modular backend framework for web applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[macro_use]
extern crate ngyn_macros;
use ngyn_macros::Param;
struct UserParam {
    id: i32,
    name: String,
}
impl ngyn::shared::server::Transformer<'_> for UserParam {
    fn transform(cx: &mut ngyn::prelude::NgynContext<'_>) -> Self {
        let param = ngyn::shared::server::Param::transform(cx);
        UserParam {
            id: param.get("id").unwrap_or_default(),
            name: param.get("name").unwrap_or_default(),
        }
    }
}