#coap #iot

no-std coap-numbers

Constants for the CoAP protocol

6 releases

0.2.2 Feb 2, 2023
0.2.1 Feb 1, 2023
0.2.0 Jul 17, 2022
0.1.2 Sep 8, 2020
0.1.1 Aug 19, 2020

#10 in #no-alloc

Download history 537/week @ 2022-12-06 495/week @ 2022-12-13 176/week @ 2022-12-20 113/week @ 2022-12-27 173/week @ 2023-01-03 197/week @ 2023-01-10 328/week @ 2023-01-17 424/week @ 2023-01-24 245/week @ 2023-01-31 227/week @ 2023-02-07 371/week @ 2023-02-14 362/week @ 2023-02-21 195/week @ 2023-02-28 160/week @ 2023-03-07 156/week @ 2023-03-14 110/week @ 2023-03-21

659 downloads per month
Used in 10 crates (9 directly)


404 lines

The coap-numbers crate provides constants used in the CoAP protocol and registered in the CoRE Parameters registry at IANA.

Along with the numeric values, it provides converters to string representations, and classification in case the numbers carry inherent.

It does not provide enums or newtypes for them, but can serve as a base to build those. (Especially for constrained platforms, the expectation here is that they'd have an enum of things they can work with, and everything else is just unsupported and doesn't need to waste any more space).

Minimum Supported Rust Version (MSRV)

This crate is build-tested on stable Rust 1.51.0. It might compile with older versions but that may change at any time.


This crate primarily contains constants for the CoAP Protocol, as maintained in the CoRE Parameters registry at IANA.

In addition to the constants themselves, it provides functions to get their names and extractable properties.

This crate tries not to be opinionated in terms of types: It uses the Rust types that reflect the possible ranges of the registry, but does not attempt to create suitable newtypes or enums for the constants. That is left to downstream libraries, as they can best judge whether they need to represent values that are unrecognized anyway.


The only optional feature is alloc, which is opt-in. It adds functions that return a String; those typically have formatter based functions they point to for replacement.

No runtime deps


  • alloc
  • nightly_docs