struct PageState(u32);
Expand description
u32 to pack the state of a guest memory page.
- If the page is not on the swap file, the value is zero.
- MSB: Whether the page is stale or not. (0: stale, 1: present).
- lower 31 bits: The corresponding file page index + 1. Never be zero.
Tuple Fields§
§0: u32
Implementations§
source§impl PageState
impl PageState
const IDX_FILE_MASK: u32 = 2_147_483_647u32
const PRESENT_BIT_MASK: u32 = 2_147_483_648u32
fn is_none(&self) -> bool
fn idx_file(&self) -> Option<usize>
fn is_present(&self) -> bool
fn update(&mut self, idx_file: usize)
fn mark_as_present(&mut self)
fn clear(&mut self)
fn free(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PageState
impl RefUnwindSafe for PageState
impl Send for PageState
impl Sync for PageState
impl Unpin for PageState
impl UnwindSafe for PageState
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)