Module swc_common::plugin
source · [−]plugin-base
only.Expand description
Plugin support.
We need to replace operations related to thread-local variables in
swc_common
.
Structs
Wraps internal representation of serialized data for exchanging data between plugin to the host. Consumers should not rely on specific details of byte format struct contains: it is strict implementation detail which can change anytime.
A wrapper type for the structures to be passed into plugins serializes the contained value out-of-line so that newer versions can be viewed as the older version.
The resolver for an archived VersionedSerializable
Enums
An archived PluginError
Enum for possible errors while running transform via plugin.
This error indicates internal operation failure either in plugin_runner
or plugin_macro. Plugin’s transform fn itself does not allow to return
error - instead it should use provided handler
to emit corresponding error
to the host.
The resolver for an archived PluginError
Functions
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.
Deserialize Fallible
struct from raw ptr. This is similar to
deserialize_from_ptr
but for the struct requires bounds to the
SharedSerializeRegistry which cannot be Infallible. Internally this does
not call deserialize with Infallible deserializer, use
SharedDeserializeMap instead.