pub enum Error {
Show 18 variants
Io(Error),
Serial(SerialError),
Address(String),
Emulator(String),
NoReply {
command: String,
},
Remote(String),
Kermit(Error),
Stalled(Duration),
Xmodem(Error),
Unsupported(String),
Calculator {
message: String,
stack: Vec<String>,
},
CommandTooLong {
command: String,
len: usize,
max: usize,
},
Charset(char),
Name(String),
FileName(String),
Filer(JobError),
Reply(String),
Object(String),
}Expand description
Everything that can go wrong talking to a calculator.
Variants§
Io(Error)
The link failed.
Serial(SerialError)
The serial port could not be opened or configured. The variant
exists in every build so that native stays additive (a match on
Error compiles with and without it); only native makes one.
Address(String)
The link address is not tcp://host:port, saturnus://[MODEL@]ROM
or a device path.
Emulator(String)
The in-process emulator could not be started (missing ROM, wrong
size, no saturnus feature).
NoReply
A host command got no reply in time. A C packet is sent only once
(resent, it would run again), so the command may still be running
on the calculator or may have run; the next connection resyncs
(Calculator::sync).
Remote(String)
The calculator sent a Kermit E packet (text translated from the HP
character set), e.g. Undefined Name for a GET of a missing variable.
Kermit(Error)
A Kermit failure other than an E packet: retries exhausted, protocol violation, cancelled.
Stalled(Duration)
A Kermit transaction made no progress (no new packet accepted) for longer than its retries take, while the peer kept the link busy (a packet replayed over and over, noise): it was cancelled. The duration is the limit that ran out.
Xmodem(Error)
An XModem transfer failed: no start within the start window, retries exhausted, or cancelled by the calculator (two CANs).
Unsupported(String)
The calculator cannot do what was asked, e.g. XModem on a 48S/SX.
Calculator
A host command ran but the calculator reported an error. stack is
what the calculator returned with it, level 1 first.
Fields
CommandTooLong
A host command does not fit in one Kermit C packet.
Fields
Charset(char)
A character has no code in the HP character set.
Name(String)
Not a valid calculator variable name.
FileName(String)
A file or folder name whose %XX codes do not read back as UTF-8,
so it names no variable or directory (names).
Filer(JobError)
A Filer job on an HP 100LX/200LX failed: the server refused a
request (a file-system code with its meaning), the name exists, or
the link broke (filer_proto::JobError).
Reply(String)
The calculator’s reply could not be understood.
Object(String)
A file is not a usable HP object.
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()