pub struct L2Table { /* private fields */ }Implementations§
Source§impl L2Table
impl L2Table
pub fn get_entry( &self, info: &Qcow2Info, lookup_addr: &SplitGuestOffset, ) -> L2Entry
pub fn get_mapping( &self, info: &Qcow2Info, lookup_addr: &SplitGuestOffset, ) -> Mapping
Sourcepub fn map_cluster(
&mut self,
index: usize,
host_cluster: u64,
) -> Option<(u64, usize)>
pub fn map_cluster( &mut self, index: usize, host_cluster: u64, ) -> Option<(u64, usize)>
If the previous entry pointed to an allocated cluster, return the old allocation so its refcount can be decreased (offset of the first cluster and number of clusters – compressed clusters can span across host cluster boundaries).
If the allocation is reused, None is returned, so this function
only returns Some(_) if some cluster is indeed leaked.
Sourcepub fn set_cluster_bits(&mut self, cluster_bits: usize)
pub fn set_cluster_bits(&mut self, cluster_bits: usize)
Following L2Table creating, and we are supporting l2 table slice
pub fn new(offset: Option<u64>, size: usize, cluster_bits: usize) -> L2Table
Trait Implementations§
Source§impl From<Qcow2IoBuf<L2Entry>> for L2Table
impl From<Qcow2IoBuf<L2Entry>> for L2Table
Source§fn from(data: Qcow2IoBuf<L2Entry>) -> Self
fn from(data: Qcow2IoBuf<L2Entry>) -> Self
Converts to this type from the input type.
Source§impl Table for L2Table
impl Table for L2Table
type Entry = L2Entry
fn as_ptr(&self) -> *const u8
fn as_mut_ptr(&mut self) -> *mut u8
fn get_offset(&self) -> Option<u64>
fn set_offset(&mut self, offset: Option<u64>)
fn entries(&self) -> usize
fn get(&self, index: usize) -> L2Entry
fn set(&mut self, index: usize, entry: L2Entry)
fn set_with_return( &mut self, index: usize, value: Self::Entry, ) -> Qcow2Result<()>
fn byte_size(&self) -> usize
fn cluster_count(&self, qcow2_info: &Qcow2Info) -> usize
fn is_update(&self) -> bool
fn new_empty(offset: Option<u64>, size: usize) -> Self
fn set_dirty(&self, _idx: usize)
fn pop_dirty_blk_idx(&self, _val: Option<u32>) -> Option<u32>
Auto Trait Implementations§
impl Freeze for L2Table
impl RefUnwindSafe for L2Table
impl Send for L2Table
impl Sync for L2Table
impl Unpin for L2Table
impl UnwindSafe for L2Table
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