pkg

Attribute Macro pkg 

Source
#[pkg]
Expand description

Package

A framework-like attribute placed in inline modules that creates all the mandatory elements and optional elements related to wtx::pkg::Package.

struct SomeApi;

#[wtx_macros::pkg(data_format(json_rpc("SomeEndpoint")), id(SomeApiId))]
mod pkg {
  #[pkg::req_data]
  pub struct SomeEndpointReq<'string> {
    ping: &'string str,
  }

  #[pkg::res_data]
  pub struct SomeEndpointRes {
    pong: String,
  }
}