Struct RefBlock

Source
pub struct RefBlock { /* private fields */ }

Implementations§

Source§

impl RefBlock

Source

pub fn new(refcount_order: u8, size: usize, offset: Option<u64>) -> Self

Source

pub fn set_refcount_order(&mut self, refcount_order: u8)

Source

pub fn increment(&mut self, index: usize) -> Qcow2Result<()>

Source

pub fn decrement(&mut self, index: usize) -> Qcow2Result<()>

Source

pub fn get_free_range(&self, start: usize, count: usize) -> Option<Range<usize>>

Source

pub fn get_tail_free_range(&self) -> Option<Range<usize>>

Source

pub fn alloc_range(&mut self, s: usize, e: usize) -> Qcow2Result<()>

Trait Implementations§

Source§

impl Debug for RefBlock

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Qcow2IoBuf<RefBlockEntry>> for RefBlock

Source§

fn from(data: Qcow2IoBuf<RefBlockEntry>) -> Self

Converts to this type from the input type.
Source§

impl Table for RefBlock

Source§

fn byte_size(&self) -> usize

RefBlock is special, since RefBlockEntry is defined as u64

Source§

type Entry = RefBlockEntry

Source§

fn as_ptr(&self) -> *const u8

Source§

fn as_mut_ptr(&mut self) -> *mut u8

Source§

fn get_offset(&self) -> Option<u64>

Source§

fn set_offset(&mut self, offset: Option<u64>)

Source§

fn entries(&self) -> usize

Source§

fn get(&self, index: usize) -> Self::Entry

Source§

fn set(&mut self, index: usize, value: Self::Entry)

Source§

fn set_with_return( &mut self, index: usize, value: Self::Entry, ) -> Qcow2Result<()>

Source§

fn cluster_count(&self, qcow2_info: &Qcow2Info) -> usize

Source§

fn is_update(&self) -> bool

Source§

fn new_empty(offset: Option<u64>, size: usize) -> Self

Source§

fn set_dirty(&self, _idx: usize)

Source§

fn pop_dirty_blk_idx(&self, _val: Option<u32>) -> Option<u32>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.