rfc_7252_doc!() { /* proc-macro */ }
Expand description

Give me a section of RFC7252 (e.g. 5.9.1.1 no trailing dot) and I will scrape the rfc for that section then yield an inline #[doc] attribute containing that section.

use toad_macros::rfc_7252_doc;

#[doc = rfc_7252_doc!("5.9.1.1")]
// Expands to:
/// # 2.04 Changed
/// [_generated from RFC7252 section 5.9.1.1_](<link to section at ietf.org>)
///
/// This Response Code is like HTTP 204 "No Content" but only used in
/// response to POST and PUT requests.  The payload returned with the
/// response, if any, is a representation of the action result.
///
/// This response is not cacheable.  However, a cache MUST mark any
/// stored response for the changed resource as not fresh.
struct Foo;