pub struct Gpa(/* private fields */);
Expand description
Strong type for Guest Physical Addresses.
§Examples
let gpa = Gpa::new(0x1337_123);
assert_eq!(gpa.offset(), 0x123);
assert_eq!(gpa.page_aligned(), false);
let aligned_gpa = gpa.page_align();
assert_eq!(aligned_gpa.u64(), 0x1337_000);
assert_eq!(aligned_gpa.page_aligned(), true);
let next_gpa = gpa.next_aligned_page();
assert_eq!(next_gpa.u64(), 0x1338_000);
Implementations§
Trait Implementations§
Source§impl AddAssign for Gpa
Operator += for Gpa
.
impl AddAssign for Gpa
Operator += for Gpa
.
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl Gxa for Gpa
impl Gxa for Gpa
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 Gpa
impl Ord for Gpa
Source§impl PartialOrd for Gpa
impl PartialOrd for Gpa
impl Copy for Gpa
impl Eq for Gpa
impl StructuralPartialEq for Gpa
Auto Trait Implementations§
impl Freeze for Gpa
impl RefUnwindSafe for Gpa
impl Send for Gpa
impl Sync for Gpa
impl Unpin for Gpa
impl UnwindSafe for Gpa
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