#[non_exhaustive]pub enum Error {
Show 15 variants
Truncated {
got: usize,
need: usize,
},
LengthMismatch {
declared: usize,
actual: usize,
},
BadCrc {
expected: u16,
actual: u16,
},
DeviceStatus(u32),
ClassRefused {
class: ObjectClass,
status: u32,
},
UnexpectedResponse {
expected: u32,
got: u32,
},
UnexpectedLocation {
requested: Location,
reported: Location,
},
UnexpectedPartition {
requested: u32,
reported: u32,
},
Enumeration {
bank: u32,
answered: Location,
slots: u32,
},
ScanLimit {
bank: u32,
limit: u32,
},
Transport(String),
Envelope(String),
Replay(String),
InvalidArgument(String),
Io(Error),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
LengthMismatch
BadCrc
DeviceStatus(u32)
ClassRefused
The device refused SESSION_OPEN for this class: it does not serve the class.
A refusal of any other command stays a Error::DeviceStatus.
UnexpectedResponse
UnexpectedLocation
UnexpectedPartition
Enumeration
An inventory walk contradicted the geometry declared by the instrument.
ScanLimit
Transport(String)
The byte pipe itself failed — a USB transfer error, a missing device, a claim refusal. Nothing about message content belongs here.
Envelope(String)
The CBIN header around an entity body is wrong: bad magic, a checksum that
does not match the body, a malformed format tag.
Replay(String)
A replay script that could not be parsed or was contradicted by the code under
test. Only produced by the replay feature’s transport.
InvalidArgument(String)
Io(Error)
Implementations§
Source§impl Error
impl Error
Sourcepub fn expect_kind(&self) -> ErrKind
pub fn expect_kind(&self) -> ErrKind
This failure’s kind in a replay script’s expect: err <kind> header.
The vocabulary is short on purpose — it exists to tell one expected refusal from another — so a failure it does not name is reported as the nearest kind rather than left out, where the script would claim the operation succeeded. A script that names the wrong kind fails the sweep, which is the report; a script that names none passes silently, which is not.
The match is exhaustive so that a new variant is given a kind rather than
defaulting into one, and ErrKind::matches is its inverse.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()