Enum android_sparse::file::Chunk [−][src]
pub enum Chunk {
Raw {
file: Rc<RefCell<StdFile>>,
offset: u64,
num_blocks: u32,
},
Fill {
fill: [u8; 4],
num_blocks: u32,
},
DontCare {
num_blocks: u32,
},
Crc32 {
crc: u32,
},
}A sparse file chunk.
A chunk represents either:
- a part of the raw image of size
num_blocks * BLOCK_SIZE, or - the CRC32 checksum of the raw image data up to this point
Variants
RawChunk representing blocks of raw bytes.
To keep memory usage low, a raw chunk holds a reference to its backing file instead of the actual raw data.
Fields of Raw
file: Rc<RefCell<StdFile>> | Reference to the backing file. |
offset: u64 | Offset into the backing file to the start of the raw bytes. |
num_blocks: u32 | Number of blocks contained in this chunk. |
FillChunk representing blocks filled with the same 4-byte value.
Fields of Fill
fill: [u8; 4] | The 4-byte fill value. |
num_blocks: u32 | Number of blocks contained in this chunk. |
DontCareChunk representing blocks of ignored data.
Fields of DontCare
num_blocks: u32 | Number of blocks contained in this chunk. |
Crc32Chunk holding the CRC32 checksum value of all previous data chunks.
Fields of Crc32
crc: u32 | The CRC32 checksum value. |
Methods
impl Chunk[src]
impl Chunkpub fn sparse_size(&self) -> u32[src]
pub fn sparse_size(&self) -> u32Returns this chunk's size in a sparse image.
pub fn raw_size(&self) -> u32[src]
pub fn raw_size(&self) -> u32Returns the size of this chunk's decoded raw data.
pub fn num_blocks(&self) -> u32[src]
pub fn num_blocks(&self) -> u32Returns the number of blocks contained in this chunk.