Cargo Features

coap-message-utils has no features set by default.

[dependencies]
coap-message-utils = { version = "0.3.3", features = ["error_unprocessed_coap_option", "error_request_body_error_position", "error_max_age", "error_title"] }
error_unprocessed_coap_option

## Feature flags

### Details of the Error struct

Without these, the [Error] struct is just a code u8.

Allow storing the RFC9290 "Unprocessed CoAP option" problem detail in Bad Option errors, and emit it in CBOR payloads. If this feature is not enabled, any such detail provided in errors is silently not emitted.

error_request_body_error_position

Allow storing the RFC9290 "Request Body Error Position" problem detail in Bad Request errors, and emit it in CBOR payloads. If this feature is not enabled, any such detail provided in errors is silently not emitted.

error_max_age

Store a Max-Age of the error. The method [Error::with_max_age()] is only available when this feature is enabled.

error_title

Store and render the title of the error (for use as a diagnostic payload or as RFC9290 "Title" problem detail). If this feature is not enabled, any such detail provided in errors is silently not emitted.

The detail is also stored under certain debugging conditions (currently associated with debug_assert, but the condition may change) for the mere benefit of enhancing the Debug implementation's usability.

Note that due to coap-message's current constraints and concerns for stack size, this detail is not shown when RFC9290 format is indicated.