Function swc_plugin::utils::swc_common::plugin::deserialize_from_ptr
source · [−]pub unsafe fn deserialize_from_ptr<W>(
raw_allocated_ptr: *const u8,
raw_allocated_ptr_len: i32
) -> Result<W, Error> where
W: Archive,
<W as Archive>::Archived: Deserialize<W, SharedDeserializeMap>,
Expand description
Simple wrapper around constructing PluginSerializedBytes from raw ptr to call deserialize to support common workflow on both of runtime (host / plugin) to instantiate a struct from allocated / copied ptr.
Safety
This is naturally unsafe by constructing bytes slice from raw ptr.