Struct extism_pdk::MemoryHandle
source · pub struct MemoryHandle {
pub offset: u64,
pub length: u64,
}
Expand description
MemoryHandle
describes where in memory a block of data is stored
Fields§
§offset: u64
The offset of the region in Extism linear memory
length: u64
The length of the memory region
Implementations§
source§impl MemoryHandle
impl MemoryHandle
sourcepub unsafe fn new(offset: u64, length: u64) -> MemoryHandle
pub unsafe fn new(offset: u64, length: u64) -> MemoryHandle
Create a new MemoryHandle
from an offset in memory and length
§Safety
This function is unsafe because the specified memory region may not be valid.
sourcepub fn null() -> MemoryHandle
pub fn null() -> MemoryHandle
NULL
equivalent
Trait Implementations§
source§impl Clone for MemoryHandle
impl Clone for MemoryHandle
source§fn clone(&self) -> MemoryHandle
fn clone(&self) -> MemoryHandle
Returns a copy of the value. Read more
1.0.0 · 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 MemoryHandle
impl Debug for MemoryHandle
source§impl Ord for MemoryHandle
impl Ord for MemoryHandle
source§fn cmp(&self, other: &MemoryHandle) -> Ordering
fn cmp(&self, other: &MemoryHandle) -> Ordering
1.21.0 · 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 MemoryHandle
impl PartialEq for MemoryHandle
source§fn eq(&self, other: &MemoryHandle) -> bool
fn eq(&self, other: &MemoryHandle) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for MemoryHandle
impl PartialOrd for MemoryHandle
source§fn partial_cmp(&self, other: &MemoryHandle) -> Option<Ordering>
fn partial_cmp(&self, other: &MemoryHandle) -> Option<Ordering>
1.0.0 · source§fn 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 moreimpl Copy for MemoryHandle
impl Eq for MemoryHandle
impl StructuralPartialEq for MemoryHandle
Auto Trait Implementations§
impl RefUnwindSafe for MemoryHandle
impl Send for MemoryHandle
impl Sync for MemoryHandle
impl Unpin for MemoryHandle
impl UnwindSafe for MemoryHandle
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