pub enum Error {
InvalidCode,
InvalidOption(Error),
TokenLength,
OutOfMemory,
MsgTooShort,
EmptyNon,
RequestAck,
NonEmptyRst,
EmptyWithContent,
}Expand description
Combined error type for message encoding, parsing and checking
Variants§
InvalidCode
Invalid Code used
InvalidOption(Error)
Option could not be parsed
TokenLength
Invalid token length (greater 8)
OutOfMemory
The provided buffer is too small
MsgTooShort
The message is shorter than 4 bytes which is the minimum CoAP message length (the length of the message header)
EmptyNon
Empty Non-Confirmable message (Non-Confirmable messages may only be requests or responses).
RequestAck
Request in an ACK (ACKs may only be piggybacked responses or empty).
NonEmptyRst
Request or response in a RST message (RSTs must be empty).
EmptyWithContent
Empty message (code 0.00) with token, options or payload (empty messages must be actually empty, “An Empty message only contains the 4-byte header.”)
Trait Implementations§
impl Copy for Error
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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