Medius - Rust LibraryErrors

Errors

The Error enum and the Result alias

Every 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.

VariantMeaning
Io(std::io::Error)An underlying serial or OS error.
NotFoundNo device matched the expected VID/PID.
NoReplyNo reply to the version query during the handshake: wrong port or baud, or not a Medius box.
BadProtoVer { got }The box replied, but its proto_ver wasn't 5; got carries the reported value. See the handshake.
QueryTimeoutA query hit its deadline with no RESP back.
DisconnectedThe device disconnected.
FrameTooLongA payload was over the 512-byte frame limit.
CatchTableFull { needed, limit }A catch_events call needs needed entries and the box holds limit. Refused before anything is sent, because the box reports a refusal only in a flag.
EmptySubscriptionA catch subscription named no filters, so the stream would never yield.
CaptureNotApplicable { class }A Capture on an input class, which arrives decoded and carries no packet.
NotAnInputFilter { class }input_events was given a traffic class, which cannot decode to an input edge.
WildcardNotInputCatchFilter::everything() covers traffic too; use CatchFilter::all_input().
RelativeDirection { direction, what }A call addressed Direction::With or Against where only a fixed sign or edge fits; what names it. Those are resolved against the bearing at emit time, after the call is made; use Both, Positive, or Negative.
HalfEdgeInputFilterAn input subscription narrowed to one edge: without the release, a fresh press cannot be told from a chord. Match on Input::Press instead.
ReservedId { class, id }An exact id of 0xFFFF, which is the every-id sentinel on the wire, so the subscription would address the whole class instead. Only a media usage is wide enough to reach it.
Update { op, status, arg }The box refused a firmware update op. Carries the op, the UpdateStatus and its arg.