pub enum CoapError {
InvalidMessage(String),
UnsupportedMethod(String),
UnsupportedContentFormat(u16),
BlockTransferError(String),
DtlsError(String),
PayloadTooLarge {
size: usize,
max: usize,
},
ResourceNotFound(String),
Unauthorized(String),
Forbidden(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 9148 §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 9148 §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.
Client authentication required but not provided (4.01).
Returned when an EST operation requires mTLS client certificate authentication but no certificate was presented during the DTLS handshake.
Forbidden(String)
Authenticated client is not authorized for the request (4.03).
The peer authenticated successfully but the request is denied by an
access-control policy — e.g. the EST enrollment-authorization check
(NIAP CA PP FDP_ACF.1): the CSR names an identity the requester is not
permitted to enroll. Distinct from Unauthorized,
which means authentication itself is missing.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()