pub enum Error {
UsbError(Error),
DeviceOffline,
DeviceListNotReadable,
MissingEndpoint,
InvalidResponse(usize),
InvalidConfig(String),
NoMediaInstalled,
MediaMismatch {
expected: Media,
actual: Media,
},
ReadStatusTimeout,
PrintTimeout,
UnexpectedPhase(Phase),
PrinterError(PrinterError),
}Expand description
Main error type for P-Touch printer operations.
This enum encompasses all possible errors that can occur when using the printer, from USB communication issues to printer-specific errors.
Variants§
UsbError(Error)
USB communication error.
Wraps underlying rusb errors for device communication issues, timeouts, or permission problems.
DeviceOffline
Printer device is not connected or not responding.
This error occurs when the printer cannot be found on USB or fails to respond to initialization commands.
DeviceListNotReadable
MissingEndpoint
InvalidResponse(usize)
InvalidConfig(String)
Invalid configuration parameter provided.
This error occurs when configuration values are out of range or incompatible with the selected printer model.
NoMediaInstalled
MediaMismatch
Media type mismatch between configuration and installed tape.
The printer has different media installed than what was specified in the configuration. Check the installed tape and update config.
ReadStatusTimeout
PrintTimeout
Print job timed out waiting for completion.
The printer did not complete the print job within the expected time. This may indicate a hardware issue or very long label.
UnexpectedPhase(Phase)
PrinterError(PrinterError)
Hardware-level printer error.
Wraps printer-specific errors reported by the device itself, such as cover open, media issues, or mechanical problems.
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()