pub enum Error {
}Expand description
Why a bundle was rejected, reading one or building one.
Most variants can arise either way, because most of what makes a bundle wrong is a property of its entries rather than of its bytes — and one vocabulary for both directions is what keeps a packer from cheerfully building something no device will take. The exceptions are marked.
Variants§
TooShort
Fewer bytes than a header and a checksum. Reading only.
BadMagic
The magic did not match the one this application expects. Reading only.
BadVersion(u8)
A format version this build does not read. Carries the version seen. Reading only.
BadChecksum
The trailing CRC-32 did not match the content. Reading only.
BadEntryCount(usize)
No entries at all, or more than Format::max_entries.
Truncated
An entry ran past the end of the bundle, or the entries did not fill it exactly. Reading only.
BadRole(u8)
An entry named a role this build does not know. Carries the byte. Reading only.
PathNotUtf8
An entry’s path was not valid UTF-8. Reading only — a path being
built is already a &str.
PathTooLong
A path longer than the 255 bytes its length field can hold. Building only.
DataTooLarge
A file larger than the 4 GiB its size field can hold. Building only.
BadPath
An entry’s path was empty, absolute, or contained ., .., an
empty component or a backslash.
DuplicatePath
Two entries wanted the same path.
DuplicateRole(Role)
More than one entry claimed a role that allows only one.
UnpairedFirmware
A start*.elf arrived without its fixup*.dat, or the reverse.
Implementations§
Source§impl Error
impl Error
Sourcepub fn http_status(&self) -> u16
pub fn http_status(&self) -> u16
The HTTP status to answer this with, for a device that took the bundle over HTTP.
Always 400, and that is the content of the method rather than a placeholder: every rejection in this module is a statement about the bytes that arrived, so none of them is ever the receiver’s fault. An installer whose errors are not all client errors wraps this one and answers for the rest itself.
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()