Section
Getting Started
API
Features
Guides
Reference
AI Access
Errors
The Error enum and the Result aliasEvery fallible call returns Result<T>, the crate's alias for core::result::Result<T, Error>.
Error is #[non_exhaustive], so any match needs a wildcard arm.
| Variant | Meaning |
|---|---|
Io(std::io::Error) | An underlying serial or OS error. |
NotFound | No device matched the expected VID/PID. |
NoReply | The box never answered the version query during the handshake: wrong port or baud, or not a Medius box. |
BadProtoVer { got } | The box answered, but its proto_ver wasn't 3; got carries the reported value. See the handshake. |
QueryTimeout | A query hit its deadline with no RESP back. |
Disconnected | The device disconnected. |
FrameTooLong | A payload was over the 512-byte frame limit. |
FlashTool(String) | The flash tool failed. |
FlashTool(String) only exists with the flash feature. On a default build the variant isn't in the enum, so a match arm naming it won't compile. Gate such arms behind #[cfg(feature = "flash")] or lean on the wildcard.