Trait MemoryAddress

Source
pub trait MemoryAddress:
    PartialEq
    + Eq
    + PartialOrd
    + Ord
    + Copy
    + Clone
    + Sized
    + BitAnd<Self::RAW, Output = Self::RAW>
    + BitAndAssign<Self::RAW>
    + BitOr<Self::RAW, Output = Self::RAW>
    + BitOrAssign<Self::RAW>
    + BitXor<Self::RAW, Output = Self::RAW>
    + BitXorAssign<Self::RAW>
    + Add<Self::RAW>
    + AddAssign<Self::RAW>
    + Sub<Self, Output = Self::RAW>
    + Sub<Self::RAW, Output = Self>
    + SubAssign<Self::RAW>
    + Shr<usize, Output = Self>
    + ShrAssign<usize>
    + Shl<usize, Output = Self>
    + ShlAssign<usize>
    + Binary
    + LowerHex
    + UpperHex
    + Octal
    + Pointer {
    type RAW: Copy + PartialEq + Eq + PartialOrd + Ord + Not<Output = Self::RAW> + Add<Output = Self::RAW> + Sub<Output = Self::RAW> + BitAnd<Output = Self::RAW> + BitOr<Output = Self::RAW> + BitXor<Output = Self::RAW> + Debug + From<u8> + TryInto<usize, Error: Debug>;

    // Required method
    fn raw(self) -> Self::RAW;
}
Expand description

Trait that marks memory addresses.

An address must be a wrapper around a numeric value and thus behave like a number.

Required Associated Types§

Source

type RAW: Copy + PartialEq + Eq + PartialOrd + Ord + Not<Output = Self::RAW> + Add<Output = Self::RAW> + Sub<Output = Self::RAW> + BitAnd<Output = Self::RAW> + BitOr<Output = Self::RAW> + BitXor<Output = Self::RAW> + Debug + From<u8> + TryInto<usize, Error: Debug>

Inner address type

Required Methods§

Source

fn raw(self) -> Self::RAW

Get the raw underlying address value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl MemoryAddress for memory_addresses::arch::aarch64::PhysAddr

Source§

impl MemoryAddress for memory_addresses::arch::aarch64::VirtAddr

Source§

impl MemoryAddress for memory_addresses::arch::fallback::PhysAddr

Source§

impl MemoryAddress for memory_addresses::arch::fallback::VirtAddr

Source§

impl MemoryAddress for memory_addresses::arch::riscv64::PhysAddr

Source§

impl MemoryAddress for memory_addresses::arch::riscv64::VirtAddr

Source§

impl MemoryAddress for memory_addresses::arch::x86_64::PhysAddr

Source§

impl MemoryAddress for memory_addresses::arch::x86_64::VirtAddr