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 L1Entrys 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

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

The default arguments to be used when using the read shortcut method. Override this for any type that optionally requries arguments Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.