pub struct PassFatPointerAndDecode<T>(/* private fields */);
Expand description
Pass a T
into the host using the SCALE codec.
This encodes a T
into a Vec<u8>
using the SCALE codec and then
passes a pointer to that byte blob and its length to the host,
which then reads it and decodes back into T
.
Raw FFI type: u64
(a fat pointer; upper 32 bits is the size, lower 32 bits is the pointer)
Trait Implementations§
Source§impl<'a, T: Decode> FromFFIValue<'a> for PassFatPointerAndDecode<T>
impl<'a, T: Decode> FromFFIValue<'a> for PassFatPointerAndDecode<T>
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 PassFatPointerAndDecode<T>
impl<T> RefUnwindSafe for PassFatPointerAndDecode<T>where
T: RefUnwindSafe,
impl<T> Send for PassFatPointerAndDecode<T>where
T: Send,
impl<T> Sync for PassFatPointerAndDecode<T>where
T: Sync,
impl<T> Unpin for PassFatPointerAndDecode<T>where
T: Unpin,
impl<T> UnwindSafe for PassFatPointerAndDecode<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