Expand description
Low-level representation of CoAP messages.
The most notable item in toad_msg
is Message
;
a CoAP message very close to the actual byte layout.
Allocation
CoAP messages are growable and dynamically sized:
- The message payload (http equiv: the request/response body)
- the number of options (http equiv: headers)
- the value of an option (http equiv: header value)
Performance
This crate uses criterion
to measure performance of the heaped & heapless implementations in this crate as well as coap_lite::Packet
.
In general, toad_msg::VecMessage
performs identically to coap_lite (+/- 5%), and both are much faster than toad_msg::ArrayVecMessage
.
Benchmarks:
Serializing to bytes
Click to expand chart
Deserializing from bytes
Click to expand chart
Re-exports
pub use builder::*;
pub use code::*;
pub use id::*;
pub use opt::*;
pub use parse_error::*;
pub use token::*;
pub use ty::*;
pub use ver::*;
Modules
- Type aliases for std or alloc platforms
- MessageBuilder
- Message Code
- Message ID
- Message structs
- Message Options
- Message parsing errors
- Message Token
- Message Type
- Message Version
Structs
- Default hasher used for
CacheKey
- CoAP Messages
- Payloads and Representations
Enums
- An error occurred during a call to
Message::set
Traits
- The cache key can be used to compare messages for representing the same action against the same resource; for example requests with different IDs but the same method and cache-key affecting options (ex. path, query parameters) will yield the same cache-key.
- Methods that allow accessing & setting options known to the toad library.
- Trait for converting a sequence of bytes into some data structure
- Trait allowing fallible conversion into bytes