pub enum CoapError {
InvalidMessage(String),
UnsupportedMethod(String),
UnsupportedContentFormat(u16),
BlockTransferError(String),
DtlsError(String),
PayloadTooLarge {
size: usize,
max: usize,
},
ResourceNotFound(String),
Internal(String),
}Expand description
Errors arising from CoAP/EST-coaps protocol handling.
Variants§
InvalidMessage(String)
Malformed CoAP message (header, token, or option encoding).
UnsupportedMethod(String)
Unrecognized or unsupported CoAP method code.
UnsupportedContentFormat(u16)
Unrecognized CoAP Content-Format option value.
RFC 9483 §5.4 defines the content-format IDs that EST-coaps supports.
BlockTransferError(String)
Block-wise transfer failure per RFC 7959.
DtlsError(String)
DTLS session establishment or resumption failure.
RFC 9483 §5 requires DTLS to secure all EST-coaps exchanges.
PayloadTooLarge
Payload exceeds the configured maximum size.
Even with block-wise transfer, reassembled payloads are bounded to prevent resource exhaustion on constrained devices.
Fields
ResourceNotFound(String)
No CoAP resource matches the requested URI path.
Internal(String)
Internal server error (catch-all).
Trait Implementations§
Source§impl Error for CoapError
impl Error for CoapError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for CoapError
impl RefUnwindSafe for CoapError
impl Send for CoapError
impl Sync for CoapError
impl Unpin for CoapError
impl UnsafeUnpin for CoapError
impl UnwindSafe for CoapError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more