Struct qcow2::Qcow2 [] [src]

pub struct Qcow2<I> where
    I: ReadAt
{ /* fields omitted */ }

A qcow2 image.


extern crate positioned_io;
extern crate qcow2;

use positioned_io::ReadAt;
use qcow2::Qcow2;

// Open a file.
let file = try!(File::open("image.qcow2"));
let qcow = try!(Qcow2::open(file));

// Read some data.
let reader = try!(qcow.reader());
let mut buf = vec![0, 4096];
try!(reader.read_exact_at(5 * 1024 * 1024, &mut buf));


impl<I> Qcow2<I> where
    I: ReadAt

Get a Reader for the main virtual disk.

This allows data to be read from inside the virtual disk image.

impl<I> Qcow2<I> where
    I: ReadAt

Open a source of data as a qcow2 image.

Usually the data source io will be a file.

Get the size of each block of this qcow2 image.

Get the size of the virtual image.

This is likely to differ from the size of the qcow2 file itself, since the file can grow.

Trait Implementations

impl<I> Debug for Qcow2<I> where
    I: ReadAt

Formats the value using the given formatter.