Trait coap_message::Code [−][src]
A message code A CoAP code
For the code's meaning, see the CoAP Codes IANA subregistry or the coap_numbers::code module that lists them.
All code implementations can be converted to u8 (as they correspond to an 8-bit unsigned integer in the CoAP protocol). The conversion back is fallible to allow strict message implementations to only accept codes supported by the implementation, and/or to limit the values by type state. For example, a strict implementation may distinguish between request and response messages, and only allow the respective code class into their objects (simultaneously creating usable niches in the in-memory representations).