pub struct AllocateAndReturnByCodec<T>(/* private fields */);
Expand description
(DEPRECATED) Return T
into the runtime using the SCALE codec.
Encodes T
using the SCALE codec, allocates runtime memory using the legacy
allocator, copies the encoded payload into the runtime memory, and returns
a fat pointer to it.
THIS STRATEGY IS DEPRECATED; DO NOT USE FOR NEW HOST FUNCTIONS!
Ideally use a mutable slice to return data to the guest, for example using
the PassPointerAndWrite
strategy.
Raw FFI type: u64
(a fat pointer; upper 32 bits is the size, lower 32 bits is the pointer)
Trait Implementations§
Source§impl<T: Encode> IntoFFIValue for AllocateAndReturnByCodec<T>
impl<T: Encode> IntoFFIValue for AllocateAndReturnByCodec<T>
Source§fn into_ffi_value(
value: T,
context: &mut dyn FunctionContext,
) -> Result<Self::FFIType>
fn into_ffi_value( value: T, context: &mut dyn FunctionContext, ) -> Result<Self::FFIType>
Convert
Self::Inner
into an FFI value.Auto Trait Implementations§
impl<T> Freeze for AllocateAndReturnByCodec<T>
impl<T> RefUnwindSafe for AllocateAndReturnByCodec<T>where
T: RefUnwindSafe,
impl<T> Send for AllocateAndReturnByCodec<T>where
T: Send,
impl<T> Sync for AllocateAndReturnByCodec<T>where
T: Sync,
impl<T> Unpin for AllocateAndReturnByCodec<T>where
T: Unpin,
impl<T> UnwindSafe for AllocateAndReturnByCodec<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