1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! CoAP mesage abstraction
//!
//! This crate defines interfaces for readable and writable CoAP messages. Thus, it allows CoAP
//! servers (and possibly clients) to be written independent of the actual CoAP library that is
//! used to serialize and deserialize the messages to the protocol.
//!
//! It also provides some trivial implementations of the types: [Code] for [u8], [OptionNumber]
//! for [u16], as well as the [heapmessage::HeapMessage] for easy message storage on alloc systems.
//!
//! Error handling
//! --------------
//!
//! The readable message types are designed with minimal fallability -- for example, iterating over
//! the options can not raise a "premature end of message" style error. This encodes the concept
//! that having a message type implies validity of the message. It is backed by currently used
//! libraries (RIOT's Gcoap, jnet-coap) performing the necessary validation steps when constructing
//! message objects.
//!
//! Whether this is a good idea remains to be seen.
//!
//! Libraries that insist on minimizing the cycles spent parsing can opt to present invalid
//! messages in truncated form, but need to be aware that this has important security implications.
pub use ;
pub use ;