Skip to main content

MemoryRegionKind

Trait MemoryRegionKind 

Source
pub trait MemoryRegionKind {
    type HostBaseType: Copy;

    // Required method
    fn add(base: Self::HostBaseType, size: usize) -> Self::HostBaseType;
}
Expand description

A trait that distinguishes between different kinds of memory region representations.

This trait is used to parameterize MemoryRegion_

Required Associated Types§

Source

type HostBaseType: Copy

The type used to represent host memory addresses.

Required Methods§

Source

fn add(base: Self::HostBaseType, size: usize) -> Self::HostBaseType

Computes an address by adding a size to a base address.

§Arguments
  • base - The starting address
  • size - The size in bytes to add
§Returns

The computed end address (base + size for host-guest regions, () for guest-only regions).

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 MemoryRegionKind for HostGuestMemoryRegion

Available on non-Windows only.