use coap_message::error::RenderableOnMinimal;
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[non_exhaustive]
pub enum WriteError {
OutOfSequence,
OutOfSpace,
}
impl RenderableOnMinimal for WriteError {
type Error<IE: RenderableOnMinimal + core::fmt::Debug> = IE;
fn render<M: coap_message::MinimalWritableMessage>(
self,
msg: &mut M,
) -> Result<(), Self::Error<M::UnionError>> {
coap_message_utils::Error::internal_server_error().render::<M>(msg)
}
}
impl From<core::convert::Infallible> for WriteError {
fn from(never: core::convert::Infallible) -> Self {
match never {}
}
}