android_bootimage/
lib.rs

1extern crate byteorder;
2#[macro_use]
3extern crate quick_error;
4
5mod header;
6
7pub use header::{MagicHeader, MagicHeaderParseError, LocateSectionError};
8use std::fmt;
9
10#[derive(Debug, Eq, PartialEq, Copy, Clone)]
11pub enum Section {
12    Header,
13    Kernel,
14    Ramdisk,
15    Second,
16    DeviceTree,
17}
18
19impl fmt::Display for Section {
20    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
21        write!(formatter, "{}", match *self {
22            Section::Header => "header",
23            Section::Kernel => "kernel",
24            Section::Ramdisk => "ramdisk",
25            Section::Second => "second",
26            Section::DeviceTree => "device_tree",
27        })
28    }
29}