coap_message_implementations/
error.rs1use coap_message::error::RenderableOnMinimal;
2
3#[derive(Debug)]
8#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[non_exhaustive]
10pub enum WriteError {
11 OutOfSequence,
12 OutOfSpace,
13}
14
15impl RenderableOnMinimal for WriteError {
16 type Error<IE: RenderableOnMinimal + core::fmt::Debug> = IE;
17 fn render<M: coap_message::MinimalWritableMessage>(
18 self,
19 msg: &mut M,
20 ) -> Result<(), Self::Error<M::UnionError>> {
21 coap_message_utils::Error::internal_server_error().render::<M>(msg)
22 }
23}
24
25impl From<core::convert::Infallible> for WriteError {
26 fn from(never: core::convert::Infallible) -> Self {
27 match never {}
28 }
29}