pub struct PassFatPointerAndRead<T>(/* private fields */);
Expand description
Pass a value into the host by a fat pointer.
This casts the value into a &[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
(either as an owned type or as a reference) to the host function.
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 PassFatPointerAndRead<&'a [u8]>
impl<'a> FromFFIValue<'a> for PassFatPointerAndRead<&'a [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 moreSource§impl<'a> FromFFIValue<'a> for PassFatPointerAndRead<&'a str>
impl<'a> FromFFIValue<'a> for PassFatPointerAndRead<&'a str>
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 moreSource§impl<'a> FromFFIValue<'a> for PassFatPointerAndRead<Vec<u8>>
impl<'a> FromFFIValue<'a> for PassFatPointerAndRead<Vec<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 PassFatPointerAndRead<T>
impl<T> RefUnwindSafe for PassFatPointerAndRead<T>where
T: RefUnwindSafe,
impl<T> Send for PassFatPointerAndRead<T>where
T: Send,
impl<T> Sync for PassFatPointerAndRead<T>where
T: Sync,
impl<T> Unpin for PassFatPointerAndRead<T>where
T: Unpin,
impl<T> UnwindSafe for PassFatPointerAndRead<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