pub struct GuestAddress(pub u64);Expand description
A guest-physical address.
Newtype around u64 so the type system stops us from confusing host-virtual and
guest-physical addresses at API boundaries.
Tuple Fields§
§0: u64Implementations§
Source§impl GuestAddress
impl GuestAddress
Sourcepub fn align_down(self, align: u64) -> Result<Self>
pub fn align_down(self, align: u64) -> Result<Self>
Returns the address aligned down to the given power-of-two align.
§Errors
Returns Error::InvalidArgument if align is not a power of two.
Sourcepub const fn saturating_add(self, offset: u64) -> Self
pub const fn saturating_add(self, offset: u64) -> Self
Returns the address advanced by offset, saturating at u64::MAX.
Trait Implementations§
Source§impl Clone for GuestAddress
impl Clone for GuestAddress
Source§fn clone(&self) -> GuestAddress
fn clone(&self) -> GuestAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GuestAddress
impl Debug for GuestAddress
Source§impl Default for GuestAddress
impl Default for GuestAddress
Source§fn default() -> GuestAddress
fn default() -> GuestAddress
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GuestAddress
impl<'de> Deserialize<'de> for GuestAddress
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for GuestAddress
impl Display for GuestAddress
Source§impl From<u64> for GuestAddress
impl From<u64> for GuestAddress
Source§impl Hash for GuestAddress
impl Hash for GuestAddress
Source§impl Ord for GuestAddress
impl Ord for GuestAddress
Source§fn cmp(&self, other: &GuestAddress) -> Ordering
fn cmp(&self, other: &GuestAddress) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GuestAddress
impl PartialEq for GuestAddress
Source§fn eq(&self, other: &GuestAddress) -> bool
fn eq(&self, other: &GuestAddress) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GuestAddress
impl PartialOrd for GuestAddress
Source§impl Serialize for GuestAddress
impl Serialize for GuestAddress
impl Copy for GuestAddress
impl Eq for GuestAddress
impl StructuralPartialEq for GuestAddress
Auto Trait Implementations§
impl Freeze for GuestAddress
impl RefUnwindSafe for GuestAddress
impl Send for GuestAddress
impl Sync for GuestAddress
impl Unpin for GuestAddress
impl UnsafeUnpin for GuestAddress
impl UnwindSafe for GuestAddress
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