2 unstable releases

0.2.0 Dec 19, 2022
0.1.0 Nov 28, 2022

#968 in #api-client


Used in 2 crates

MIT license

91KB
2.5K SLoC

Lucia macros

Convenient macros that enable the fast creation of arbitrary endpoints based on the lucia framework.

#[lucia::pkg(api(MyApi), data_format(json_rpc("my_endpoint")), transport(http))]
mod my_endpoint {
  #[derive(Debug, serde::Serialize)]
  #[pkg::req_data]
  pub struct MyEndpointReq<'any> {
    pub foo: i64,
    pub bar: &'any str,
  }

  #[derive(Debug, serde::Deserialize)]
  #[pkg::res_data]
  pub struct MyEndpointRes {
    pub data: i32,
  }
}

lib.rs:

Lucia - Macros

Dependencies

~1.5MB
~33K SLoC