pub struct PluginLanguageRuntime { /* private fields */ }Expand description
Wrapper around a loaded language runtime extension.
Implementations§
Source§impl PluginLanguageRuntime
impl PluginLanguageRuntime
Sourcepub fn new(
vtable: &'static LanguageRuntimeVTable,
config: &Value,
) -> Result<Self>
pub fn new( vtable: &'static LanguageRuntimeVTable, config: &Value, ) -> Result<Self>
Create a new language runtime wrapper from a plugin vtable.
Sourcepub fn language_id(&self) -> &str
pub fn language_id(&self) -> &str
The language identifier this runtime handles (e.g., “python”).
Sourcepub fn has_dynamic_errors(&self) -> bool
pub fn has_dynamic_errors(&self) -> bool
Whether this runtime has a dynamic error model.
When true, every foreign function call can fail at runtime, so return
values are automatically wrapped in Result<T>.
Sourcepub fn lsp_config(&self) -> Result<Option<RuntimeLspConfig>>
pub fn lsp_config(&self) -> Result<Option<RuntimeLspConfig>>
Query optional child-LSP configuration declared by the runtime.
Sourcepub fn register_types(&self, types_msgpack: &[u8]) -> Result<()>
pub fn register_types(&self, types_msgpack: &[u8]) -> Result<()>
Register Shape type schemas with the runtime for stub generation.
Sourcepub fn compile(
&self,
name: &str,
source: &str,
param_names: &[String],
param_types: &[String],
return_type: Option<&str>,
is_async: bool,
) -> Result<CompiledForeignFunction>
pub fn compile( &self, name: &str, source: &str, param_names: &[String], param_types: &[String], return_type: Option<&str>, is_async: bool, ) -> Result<CompiledForeignFunction>
Pre-compile a foreign function body.
Sourcepub fn invoke(
&self,
compiled: &CompiledForeignFunction,
args_msgpack: &[u8],
) -> Result<Vec<u8>>
pub fn invoke( &self, compiled: &CompiledForeignFunction, args_msgpack: &[u8], ) -> Result<Vec<u8>>
Invoke a compiled foreign function with msgpack-encoded arguments.
Sourcepub fn dispose_function(&self, compiled: &CompiledForeignFunction)
pub fn dispose_function(&self, compiled: &CompiledForeignFunction)
Dispose of a compiled foreign function handle.
Sourcepub fn shape_source(&self) -> Result<Option<(String, String)>>
pub fn shape_source(&self) -> Result<Option<(String, String)>>
Retrieve the bundled .shape module source from this language runtime.
Returns Some((namespace, source)) if the extension bundles a Shape
module artifact, where namespace is the extension’s own namespace
(e.g. "python", "typescript") – NOT "std::core::*".
Returns None if the extension does not bundle any Shape source.