pub trait Instance: Send + Sync {
// Required methods
fn transform(
&mut self,
program_ptr: u32,
program_len: u32,
unresolved_mark: u32,
should_enable_comments_proxy: u32,
) -> Result<u32>;
fn caller(&mut self) -> Result<Box<dyn Caller<'_> + '_>>;
fn cache(&self) -> Option<ModuleCache>;
// Provided method
fn cleanup(&mut self) -> Result<()> { ... }
}
Expand description
Plugin instance
Required Methods§
Sourcefn transform(
&mut self,
program_ptr: u32,
program_len: u32,
unresolved_mark: u32,
should_enable_comments_proxy: u32,
) -> Result<u32>
fn transform( &mut self, program_ptr: u32, program_len: u32, unresolved_mark: u32, should_enable_comments_proxy: u32, ) -> Result<u32>
Execute transform.
The program parameter should use Caller::alloc to allocate
and write PluginSerializedBytes
data.
Sourcefn cache(&self) -> Option<ModuleCache>
fn cache(&self) -> Option<ModuleCache>
Export Module cache