Struct swc_plugin_runner::cache::PluginModuleCache
source · pub struct PluginModuleCache { /* private fields */ }
Implementations§
source§impl PluginModuleCache
impl PluginModuleCache
sourcepub fn new() -> Self
pub fn new() -> Self
DO NOT USE unless absolutely necessary. This is mainly for testing purpose.
sourcepub fn load_module(
&self,
wasmer_store: &Store,
binary_path: &Path
) -> Result<Module, Error>
pub fn load_module( &self, wasmer_store: &Store, binary_path: &Path ) -> Result<Module, Error>
Load a compiled plugin Module from specified path. Since plugin will be initialized per-file transform, this function tries to avoid reading filesystem per each initialization via naive in-memory map which stores raw bytecodes from file. Unlike compiled bytecode cache for the wasm, this is volatile.
Notes
This code
includes previous incorrect attempt to workaround file read issues.
In actual transform, plugins
is also being called per each transform.
Trait Implementations§
source§impl Default for PluginModuleCache
impl Default for PluginModuleCache
source§fn default() -> PluginModuleCache
fn default() -> PluginModuleCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PluginModuleCache
impl Send for PluginModuleCache
impl Sync for PluginModuleCache
impl Unpin for PluginModuleCache
impl UnwindSafe for PluginModuleCache
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref