toad_msg/msg/opt/known/
mod.rs

1/// Content-Format values
2pub mod content_format;
3pub use content_format::*;
4
5/// Observe
6pub mod observe;
7pub use observe::*;
8
9/// Block
10pub mod block;
11pub use block::*;
12
13macro_rules! opt {
14  (rfc7252($section:literal) $name:ident = $n:literal) => {
15    #[doc = ::toad_macros::rfc_7252_doc!($section)]
16    #[allow(clippy::zero_prefixed_literal)]
17    pub const $name: crate::OptNumber = crate::OptNumber($n);
18  };
19  (#[doc = $doc:expr] $name:ident = $n:literal) => {
20    #[doc = $doc]
21    #[allow(clippy::zero_prefixed_literal)]
22    pub const $name: crate::OptNumber = crate::OptNumber($n);
23  };
24}
25
26pub(crate) use opt;
27
28/// Non-repeatable options
29pub mod no_repeat {
30  use super::opt;
31
32  opt!(rfc7252("5.10.1") HOST = 3);
33  opt!(rfc7252("5.10.8.2") IF_NONE_MATCH = 5);
34  opt!(#[doc = "<https://www.rfc-editor.org/rfc/rfc7641#section-2>"]
35       OBSERVE = 6);
36  opt!(#[doc = "See [`HOST`]"]
37       PORT = 7);
38  opt!(rfc7252("5.10.3") CONTENT_FORMAT = 12);
39  opt!(rfc7252("5.10.5") MAX_AGE = 14);
40  opt!(rfc7252("5.10.4") ACCEPT = 17);
41  opt!(#[doc = include_str!("../../../../docs/Block2.md")]
42       BLOCK2 = 23);
43  opt!(#[doc = include_str!("../../../../docs/Block1.md")]
44       BLOCK1 = 27);
45  opt!(#[doc = concat!(toad_macros::rfc_7252_doc!("5.10.9"), include_str!("../../../../docs/Size.md"))]
46       SIZE2 = 28);
47  opt!(rfc7252("5.10.2") PROXY_URI = 35);
48  opt!(#[doc = "See [`PROXY_URI`]"]
49       PROXY_SCHEME = 39);
50  opt!(#[doc = concat!(toad_macros::rfc_7252_doc!("5.10.9"), include_str!("../../../../docs/Size.md"))]
51       SIZE1 = 60);
52}
53
54/// Repeatable options
55pub mod repeat {
56  use super::opt;
57
58  opt!(rfc7252("5.10.8.1") IF_MATCH = 1);
59  opt!(rfc7252("5.10.7") LOCATION_PATH = 8);
60  opt!(#[doc = "See [`super::no_repeat::HOST`]"]
61       PATH = 11);
62  opt!(#[doc = "See [`super::no_repeat::HOST`]"]
63       QUERY = 15);
64  opt!(#[doc = "See [`LOCATION_PATH`]"]
65       LOCATION_QUERY = 20);
66  opt!(#[doc = concat!(
67                toad_macros::rfc_7252_doc!("5.10.6"),
68                "\n<details><summary>ETag as a Request Option</summary>\n\n",
69                toad_macros::rfc_7252_doc!("5.10.6.2"),
70                "\n</details><details><summary>ETag as a Response Option</summary>\n\n",
71                toad_macros::rfc_7252_doc!("5.10.6.1"),
72                "</details>"
73      )]
74       ETAG = 4);
75}