pub enum FileError {
OpenBusy,
OpenFail,
IoError,
NoOpenFile,
SessionTimeout,
SessionFatalError,
SessionOutOfSync {
expected: u8,
got: u8,
},
CompressionUnsupported,
ProtocolViolation {
state: &'static str,
expected: &'static str,
},
}Expand description
Reasons a transfer failed.
Variants§
OpenBusy
Device replied PFT:busy to OPEN — another transfer is in
progress on the device side.
OpenFail
Device replied PFT:fail to OPEN — likely SD card not present
or write-protected.
IoError
Device replied PFT:ioerror to CLOSE.
NoOpenFile
Device replied PFT:invalid to CLOSE — no file was open.
SessionTimeout
The session emitted a Event::Timeout while we were waiting
for a reply.
SessionFatalError
The session emitted a Event::FatalError.
SessionOutOfSync
The session emitted Event::OutOfSync.
CompressionUnsupported
Caller requested Compression::Heatshrink but the device only
advertises none.
ProtocolViolation
Device sent the closing ok<n> for a CLOSE or ABORT without
first emitting the expected PFT:* preamble. Without that
preamble, the transfer can’t be classified as success or
failure, so we surface the violation rather than silently
claiming completion.
Trait Implementations§
Source§impl Error for FileError
impl Error for FileError
1.30.0 · 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()
Source§impl From<FileError> for UploadError
Available on (crate features blocking or tokio or serial) and (crate features blocking or tokio) only.
impl From<FileError> for UploadError
blocking or tokio or serial) and (crate features blocking or tokio) only.