#[non_exhaustive]pub enum SendError {
ProtocolTooOld {
serial: String,
opcode: u16,
have: u16,
need: u16,
},
UnknownOpcode {
opcode: u16,
},
NotConnected,
Io(Error),
}Expand description
Why a frame was not sent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ProtocolTooOld
The addressed device speaks a protocol older than the opcode requires.
A receiver silently drops any frame stamped above its own version, with no NAK, so sending anyway would report success and change nothing.
Fields
UnknownOpcode
The opcode has no entry in the protocol table, so there is no version to stamp it with.
Nothing this library sends can reach this: every opcode it declares has an entry, and a test holds that true. It exists so that adding one without an entry fails at the send rather than going out stamped with a guess.
NotConnected
The client is not connected, because it was never started or has been closed.
Io(Error)
The socket write failed.
Trait Implementations§
Source§impl Error for SendError
impl Error for SendError
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 !RefUnwindSafe for SendError
impl !UnwindSafe for SendError
impl Freeze for SendError
impl Send for SendError
impl Sync for SendError
impl Unpin for SendError
impl UnsafeUnpin for SendError
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