Skip to main content

coap_message_implementations/inmemory/
mod.rs

1//! Implementations of [`coap_message`] traits based on a serialized messages.
2//!
3//! The main structs of this modules are:
4//!
5//! * [`Message`]
6//! * [`MessageMut`]
7//!
8//! They give access to the CoAP message semantics through the [`ReadableMessage`] and
9//! [`MinimalWritableMessage`] / [`MutableWritableMessage`] traits. Its data is stored in buffers
10//! defined in this module, which can be thought of as mostly an
11//! [`AsRef<[u8]>`][core::convert::AsRef] / [`AsMut`] (i.e., data that can be owned or borrowed),
12//! but with a separate code and options-and-payloads bytes:
13//!
14//! * [`MessageBuffer`] (e.g. [`SliceBuffer`])
15//! * [`MessageBufferMut`] (e.g. [`SliceBufferMut`])
16#![cfg_attr(feature = "downcast", allow(unsafe_code))]
17
18// Needed by various modules
19use coap_message::{
20    MinimalWritableMessage, MutableWritableMessage, ReadableMessage, WithSortedOptions,
21};
22
23mod buffer_impl;
24#[cfg(feature = "alloc")]
25mod buffer_impl_alloc;
26mod buffer_traits;
27mod iterators;
28mod read_impl;
29mod write_impl;
30
31pub use super::error::WriteError;
32pub use buffer_impl::*;
33#[cfg(feature = "alloc")]
34pub use buffer_impl_alloc::*;
35pub use buffer_traits::*;
36pub use iterators::*;
37pub use read_impl::*;
38pub use write_impl::MessageMut;