Struct vm_memory::guest_memory::MemoryRegionAddress
source · [−]pub struct MemoryRegionAddress(pub u64);
Expand description
Represents an offset inside a region.
Tuple Fields
0: u64
Trait Implementations
sourceimpl Address for MemoryRegionAddress
impl Address for MemoryRegionAddress
sourcefn new(value: u64) -> MemoryRegionAddress
fn new(value: u64) -> MemoryRegionAddress
Creates an address from a raw address value.
sourcefn checked_offset_from(&self, base: MemoryRegionAddress) -> Option<u64>
fn checked_offset_from(&self, base: MemoryRegionAddress) -> Option<u64>
Computes the offset from this address to the given base address. Read more
sourcefn checked_add(&self, other: u64) -> Option<MemoryRegionAddress>
fn checked_add(&self, other: u64) -> Option<MemoryRegionAddress>
Computes self + other
, returning None
if overflow occurred.
sourcefn overflowing_add(&self, other: u64) -> (MemoryRegionAddress, bool)
fn overflowing_add(&self, other: u64) -> (MemoryRegionAddress, bool)
Computes self + other
. Read more
sourcefn unchecked_add(&self, offset: u64) -> MemoryRegionAddress
fn unchecked_add(&self, offset: u64) -> MemoryRegionAddress
Computes self + offset
. Read more
sourcefn checked_sub(&self, other: u64) -> Option<MemoryRegionAddress>
fn checked_sub(&self, other: u64) -> Option<MemoryRegionAddress>
Subtracts two addresses, checking for underflow. If underflow happens, None
is returned.
sourcefn overflowing_sub(&self, other: u64) -> (MemoryRegionAddress, bool)
fn overflowing_sub(&self, other: u64) -> (MemoryRegionAddress, bool)
Computes self - other
. Read more
sourcefn unchecked_sub(&self, other: u64) -> MemoryRegionAddress
fn unchecked_sub(&self, other: u64) -> MemoryRegionAddress
Computes self - other
. Read more
sourcefn mask(&self, mask: Self::V) -> Self::V
fn mask(&self, mask: Self::V) -> Self::V
Returns the bitwise and of the address with the given mask.
sourcefn unchecked_offset_from(&self, base: Self) -> Self::V
fn unchecked_offset_from(&self, base: Self) -> Self::V
Computes the offset from this address to the given base address. Read more
sourcefn checked_align_up(&self, power_of_two: Self::V) -> Option<Self>
fn checked_align_up(&self, power_of_two: Self::V) -> Option<Self>
Returns self, aligned to the given power of two.
sourcefn unchecked_align_up(&self, power_of_two: Self::V) -> Self
fn unchecked_align_up(&self, power_of_two: Self::V) -> Self
Returns self, aligned to the given power of two. Only use this when the result is guaranteed not to overflow. Read more
sourceimpl AddressValue for MemoryRegionAddress
impl AddressValue for MemoryRegionAddress
sourceimpl BitAnd<u64> for MemoryRegionAddress
impl BitAnd<u64> for MemoryRegionAddress
type Output = MemoryRegionAddress
type Output = MemoryRegionAddress
The resulting type after applying the &
operator.
sourcefn bitand(self, other: u64) -> MemoryRegionAddress
fn bitand(self, other: u64) -> MemoryRegionAddress
Performs the &
operation. Read more
sourceimpl BitOr<u64> for MemoryRegionAddress
impl BitOr<u64> for MemoryRegionAddress
type Output = MemoryRegionAddress
type Output = MemoryRegionAddress
The resulting type after applying the |
operator.
sourcefn bitor(self, other: u64) -> MemoryRegionAddress
fn bitor(self, other: u64) -> MemoryRegionAddress
Performs the |
operation. Read more
sourceimpl Clone for MemoryRegionAddress
impl Clone for MemoryRegionAddress
sourcefn clone(&self) -> MemoryRegionAddress
fn clone(&self) -> MemoryRegionAddress
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MemoryRegionAddress
impl Debug for MemoryRegionAddress
sourceimpl Default for MemoryRegionAddress
impl Default for MemoryRegionAddress
sourcefn default() -> MemoryRegionAddress
fn default() -> MemoryRegionAddress
Returns the “default value” for a type. Read more
sourceimpl Ord for MemoryRegionAddress
impl Ord for MemoryRegionAddress
sourceimpl PartialEq<MemoryRegionAddress> for MemoryRegionAddress
impl PartialEq<MemoryRegionAddress> for MemoryRegionAddress
sourcefn eq(&self, other: &MemoryRegionAddress) -> bool
fn eq(&self, other: &MemoryRegionAddress) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MemoryRegionAddress) -> bool
fn ne(&self, other: &MemoryRegionAddress) -> bool
This method tests for !=
.
sourceimpl PartialOrd<MemoryRegionAddress> for MemoryRegionAddress
impl PartialOrd<MemoryRegionAddress> for MemoryRegionAddress
sourcefn partial_cmp(&self, other: &MemoryRegionAddress) -> Option<Ordering>
fn partial_cmp(&self, other: &MemoryRegionAddress) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for MemoryRegionAddress
impl Eq for MemoryRegionAddress
impl StructuralEq for MemoryRegionAddress
impl StructuralPartialEq for MemoryRegionAddress
Auto Trait Implementations
impl RefUnwindSafe for MemoryRegionAddress
impl Send for MemoryRegionAddress
impl Sync for MemoryRegionAddress
impl Unpin for MemoryRegionAddress
impl UnwindSafe for MemoryRegionAddress
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more