Struct qcow::Qcow2 [−][src]
pub struct Qcow2 {
pub header: QcowHeader,
pub snapshots: Vec<Snapshot>,
pub l1_table: Vec<L1Entry>,
}
Expand description
Parsed representation of a qcow2 file.
Can be aquired by using one of:
and then using DynamicQcow::unwrap_qcow2
.
Example
let qcow = qcow::open(PATH).unwrap();
Fields
header: QcowHeader
Header of the qcow as parsed from the file, contains top-level data about the qcow
snapshots: Vec<Snapshot>
List of snapshots present within this qcow
l1_table: Vec<L1Entry>
Active table of L1Entry
s used for handling lookups of contents
Implementations
Get the size of a cluster in bytes from the qcow
Create a reader for reading from the guest virtual drive
Example
use std::io::Read;
use std::fs::File;
let qcow = qcow::open(PATH)?.unwrap_qcow2();
let mut file = File::open(PATH)?;
let mut reader = qcow.reader(&mut file);
// read first 10 bytes from virtual drive
let mut buf = [0u8; 10];
reader.read_exact(&mut buf)?;
Note: if reader
is not identical to the source file unexpected things will happen.
Trait Implementations
The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more
fn read_options<R: Read + Seek>(
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
fn read_options<R: Read + Seek>(
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
Read the type from the reader
Read the type from the reader while assuming no arguments have been passed Read more
Read the type from the reader using the specified arguments