query_info_data

Macro query_info_data 

Source
macro_rules! query_info_data {
    ($name:ident $($info_type:ident: $content:ty, )+) => { ... };
}
Expand description

Internal helper macro to easily generate fields & methods for QueryInfoData.

Builds:

  1. The enum with the specified name, with variants for each info type specified. This includes:
  • A method to get the info type of the enum variant - info_type().
  • A method to get the name of the enum variant - name().
  • implementations of From<ContentType> for each content type.
  • Methods to unwrap the content type, named as_<variant_name_in_snake_case>().
  1. A generic struct names Raw<name> to hold the raw data, with a method to convert it to the actual data.