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.
Auto Trait Implementations§
impl Freeze for PluginLanguageRuntime
impl RefUnwindSafe for PluginLanguageRuntime
impl Send for PluginLanguageRuntime
impl Sync for PluginLanguageRuntime
impl Unpin for PluginLanguageRuntime
impl UnsafeUnpin for PluginLanguageRuntime
impl UnwindSafe for PluginLanguageRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more