pub struct PassFatPointerAndReadWrite<T>(/* private fields */);
Expand description
Pass a value into the host by a fat pointer, writing it back after the host call ends.
This casts the value into a &mut [u8]
and passes a pointer to that byte blob and its length
to the host. Then the host reads that blob and converts it into an owned type and passes it
as a mutable reference to the host function. After the host function finishes the byte blob
is written back into the guest memory.
Raw FFI type: u64
(a fat pointer; upper 32 bits is the size, lower 32 bits is the pointer)
Trait Implementations§
Source§impl<'a> FromFFIValue<'a> for PassFatPointerAndReadWrite<&'a mut [u8]>
impl<'a> FromFFIValue<'a> for PassFatPointerAndReadWrite<&'a mut [u8]>
Source§fn from_ffi_value(
context: &mut dyn FunctionContext,
arg: Self::FFIType,
) -> Result<Self::Owned>
fn from_ffi_value( context: &mut dyn FunctionContext, arg: Self::FFIType, ) -> Result<Self::Owned>
Creates
Self::Owned
from the given arg
received through the FFI boundary from the
runtime.Source§fn take_from_owned(owned: &'a mut Self::Owned) -> Self::Inner
fn take_from_owned(owned: &'a mut Self::Owned) -> Self::Inner
Creates
Self::Inner
from an owned value.Source§fn write_back_into_runtime(
value: Self::Owned,
context: &mut dyn FunctionContext,
arg: Self::FFIType,
) -> Result<()>
fn write_back_into_runtime( value: Self::Owned, context: &mut dyn FunctionContext, arg: Self::FFIType, ) -> Result<()>
Write back a modified
value
back into the runtime’s memory. Read moreAuto Trait Implementations§
impl<T> Freeze for PassFatPointerAndReadWrite<T>
impl<T> RefUnwindSafe for PassFatPointerAndReadWrite<T>where
T: RefUnwindSafe,
impl<T> Send for PassFatPointerAndReadWrite<T>where
T: Send,
impl<T> Sync for PassFatPointerAndReadWrite<T>where
T: Sync,
impl<T> Unpin for PassFatPointerAndReadWrite<T>where
T: Unpin,
impl<T> UnwindSafe for PassFatPointerAndReadWrite<T>where
T: UnwindSafe,
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