Skip to main content

VmPtr

Trait VmPtr 

Source
pub trait VmPtr: Copy {
    type Target;

    // Provided methods
    fn nullable(self) -> Option<Self> { ... }
    fn vm_read_uninit(self) -> VmResult<MaybeUninit<Self::Target>> { ... }
    fn vm_read(self) -> VmResult<Self::Target>
       where Self::Target: AnyBitPattern { ... }
}
Expand description

A virtual memory pointer.

Required Associated Types§

Source

type Target

The type of data that the pointer points to.

Provided Methods§

Source

fn nullable(self) -> Option<Self>

Returns None if the pointer is null, otherwise returns Some(self).

Source

fn vm_read_uninit(self) -> VmResult<MaybeUninit<Self::Target>>

Reads the value from this virtual memory pointer. In contrast to VmPtr::vm_read, this does not require that the value has to be initialized.

Source

fn vm_read(self) -> VmResult<Self::Target>
where Self::Target: AnyBitPattern,

Reads the value from this virtual memory pointer.

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.

Implementations on Foreign Types§

Source§

impl<T> VmPtr for *const T

Source§

impl<T> VmPtr for *mut T

Source§

impl<T> VmPtr for NonNull<T>

Implementors§