pub struct Gva(/* private fields */);
Expand description
Strong type for Guest Virtual Addresses.
§Examples
let gva = Gva::new(0x1337_fff);
assert_eq!(gva.offset(), 0xfff);
assert_eq!(gva.page_aligned(), false);
let aligned_gva = gva.page_align();
assert_eq!(aligned_gva.u64(), 0x1337_000);
assert_eq!(aligned_gva.page_aligned(), true);
let next_gva = gva.next_aligned_page();
assert_eq!(next_gva.u64(), 0x1338_000);
Implementations§
Trait Implementations§
Source§impl AddAssign for Gva
Operator += for Gva
.
impl AddAssign for Gva
Operator += for Gva
.
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl Gxa for Gva
impl Gxa for Gva
Source§fn u64(&self) -> u64
fn u64(&self) -> u64
Get the underlying u64
.
§Examples
let gva = Gva::new(0xdeadbeef);
assert_eq!(gva.u64(), 0xdeadbeef);
Source§fn page_aligned(&self) -> bool
fn page_aligned(&self) -> bool
Is it page aligned?
Source§fn page_align(&self) -> Self
fn page_align(&self) -> Self
Page-align it.
Source§fn next_aligned_page(self) -> Self
fn next_aligned_page(self) -> Self
Get the next aligned page.
Source§impl Ord for Gva
impl Ord for Gva
Source§impl PartialOrd for Gva
impl PartialOrd for Gva
impl Copy for Gva
impl Eq for Gva
impl StructuralPartialEq for Gva
Auto Trait Implementations§
impl Freeze for Gva
impl RefUnwindSafe for Gva
impl Send for Gva
impl Sync for Gva
impl Unpin for Gva
impl UnwindSafe for Gva
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