Skip to main content

Module session

Module session 

Source
Expand description

Verify-by-reread orchestration, I/O-free.

VerifySession is the brain of send_and_verify, extracted from the MQTT client so it can be tested without a network: you publish a command, then feed it the printer’s report messages one at a time via VerifySession::observe; it returns a CommandOutcome the moment it can conclude, and VerifySession::timed_out gives the verdict when no conclusive message arrives in time. The real client is a thin async shell around this; tests drive it with a [crate::core::fake::FakePrinter] message sequence.

The order of operations matters and is the reason this is per-message:

  • the ACK (echoed sequence_id + result/reason under the command’s category) must be matched as its message merges, before a later push_status overwrites that category’s sequence_id with the printer’s own counter (the two-kinds-of-sequence_id hazard);
  • the print_error baseline is captured from the first full snapshot so only a new fault is blamed on the command.

Structs§

VerifySession
Drives verify-by-reread for one command over a stream of report messages.

Enums§

CommandOutcome
The result of verifying a control command.
VerifyStage
Which stage of verification failed to confirm a command.