Struct qcow2::Qcow2
[−]
[src]
pub struct Qcow2<I> where
I: ReadAt, { /* fields omitted */ }
A qcow2 image.
Examples
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));
Methods
impl<I> Qcow2<I> where
I: ReadAt,
[src]
I: ReadAt,
fn reader<'a>(&'a self) -> Result<Reader<I>>
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,
[src]
I: ReadAt,
fn open(io: I) -> Result<Self>
Open a source of data as a qcow2 image.
Usually the data source io
will be a file.
fn cluster_size(&self) -> u64
Get the size of each block of this qcow2 image.
fn guest_size(&self) -> u64
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,
[src]
I: ReadAt,