macros: add type-wide attributes

This commit is contained in:
hinto.janai 2024-07-08 15:31:55 -04:00
parent 8bc3fe522e
commit 45b51dd51a
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
2 changed files with 12 additions and 0 deletions

View file

@ -553,6 +553,9 @@ define_request_and_response! {
get_output_distribution,
cc73fe71162d564ffda8e549b79a350bca53c454 =>
core_rpc_server_commands_defs.h => 2445..=2520,
/// This type is also used in the (undocumented)
/// [`/get_output_distribution.bin`](https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.h#L138)
/// binary endpoint.
GetOutputDistribution,
Request {
amounts: Vec<u64>,

View file

@ -57,6 +57,9 @@ macro_rules! define_request_and_response {
$monero_code_line_end:literal,
// The base `struct` name.
// Attributes added here will apply to _both_
// request and response types.
$( #[$type_attr:meta] )*
$type_name:ident,
// The request type (and any doc comments, derives, etc).
@ -89,6 +92,9 @@ macro_rules! define_request_and_response {
$monero_code_line_start,
$monero_code_line_end,
)]
///
$( #[$type_attr] )*
///
$( #[$request_type_attr] )*
[<$type_name Request>] {
$(
@ -112,6 +118,9 @@ macro_rules! define_request_and_response {
$monero_code_line_start,
$monero_code_line_end,
)]
///
$( #[$type_attr] )*
///
$( #[$response_type_attr] )*
$response_base_type => [<$type_name Response>] {
$(