pub struct Qcow2Header { /* private fields */ }Implementations§
Source§impl Qcow2Header
impl Qcow2Header
pub const QCOW2_MAGIC: u32 = 1_363_560_955u32
pub const MAX_CLUSTER_SIZE: u32 = 2_097_152u32
pub const MAX_L1_SIZE: u32 = 33_554_432u32
pub const MAX_REFCOUNT_TABLE_SIZE: u32 = 8_388_608u32
pub fn from_buf(header_buf: &[u8]) -> Qcow2Result<Self>
pub fn calculate_meta_params( size: u64, cluster_bits: usize, refcount_order: u8, block_size: usize, ) -> ((u64, u32), (u64, u32), (u64, u32))
Sourcepub fn format_qcow2(
buf: &mut [u8],
size: u64,
cluster_bits: usize,
refcount_order: u8,
block_size: usize,
) -> Qcow2Result<()>
pub fn format_qcow2( buf: &mut [u8], size: u64, cluster_bits: usize, refcount_order: u8, block_size: usize, ) -> Qcow2Result<()>
Format in-ram qcow2 image, for test purpose
pub fn serialize_to_buf(&mut self) -> Qcow2Result<Vec<u8>>
pub fn version(&self) -> u32
pub fn crypt_method(&self) -> u32
pub fn compression_type(&self) -> u8
pub fn header_length(&self) -> u32
pub fn size(&self) -> u64
pub fn cluster_bits(&self) -> u32
pub fn refcount_order(&self) -> u32
pub fn l1_table_offset(&self) -> u64
pub fn l1_table_entries(&self) -> usize
pub fn set_l1_table(&mut self, offset: u64, entries: usize) -> Qcow2Result<()>
pub fn nb_snapshots(&self) -> u32
pub fn snapshots_offset(&self) -> u64
pub fn reftable_offset(&self) -> u64
pub fn reftable_clusters(&self) -> usize
pub fn set_reftable(&mut self, offset: u64, clusters: usize) -> Qcow2Result<()>
pub fn backing_filename(&self) -> Option<&String>
pub fn backing_format(&self) -> Option<&String>
pub fn feature_name( &self, feat_type: Qcow2FeatureType, bit: u32, ) -> Option<&String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Qcow2Header
impl RefUnwindSafe for Qcow2Header
impl Send for Qcow2Header
impl Sync for Qcow2Header
impl Unpin for Qcow2Header
impl UnwindSafe for Qcow2Header
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more