doc_gen_register!() { /* proc-macro */ }Expand description
Generates documentation registration function for a diagnostic.
This macro creates a registration function that can be called to register a diagnostic with a DocRegistry for documentation generation.
§Example
ⓘ
// Define diagnostic
diag! {
E.Auth.Token.EXPIRED: {
message: "Token expired",
// ...
},
}
// Generate registration code
doc_gen_register! {
E.Auth.Token.EXPIRED => ["json", "html"]
}
// Later, use the generated function:
let mut registry = DocRegistry::new("myapp", "1.0.0");
register_e_auth_token_expired_complete_for_doc_gen(&mut registry);