pub struct PyodideRuntime { /* private fields */ }Expand description
Pyodide-based Python runtime
In production, this wraps actual Pyodide WASM module. Currently provides a simulation for API design validation.
Implementations§
Source§impl PyodideRuntime
impl PyodideRuntime
Sourcepub fn new(config: RuntimeConfig) -> Self
pub fn new(config: RuntimeConfig) -> Self
Create a new runtime with configuration
Sourcepub async fn install_packages(&self, packages: &[&str]) -> KernelResult<()>
pub async fn install_packages(&self, packages: &[&str]) -> KernelResult<()>
Install Python packages via micropip
In production, this downloads and installs packages into the WASM environment.
Sourcepub fn register(&self, plugin: PythonPlugin) -> KernelResult<()>
pub fn register(&self, plugin: PythonPlugin) -> KernelResult<()>
Register a Python plugin
Sourcepub fn unregister(&self, name: &str) -> KernelResult<()>
pub fn unregister(&self, name: &str) -> KernelResult<()>
Unregister a plugin
Sourcepub async fn fire(
&self,
table: &str,
event: TriggerEvent,
context: &TriggerContext,
) -> KernelResult<TriggerResult>
pub async fn fire( &self, table: &str, event: TriggerEvent, context: &TriggerContext, ) -> KernelResult<TriggerResult>
Fire triggers for an event
Sourcepub fn stats(&self) -> &RuntimeStats
pub fn stats(&self) -> &RuntimeStats
Get runtime statistics
Sourcepub fn list_plugins(&self) -> Vec<String>
pub fn list_plugins(&self) -> Vec<String>
List registered plugins
Auto Trait Implementations§
impl !Freeze for PyodideRuntime
impl !RefUnwindSafe for PyodideRuntime
impl Send for PyodideRuntime
impl Sync for PyodideRuntime
impl Unpin for PyodideRuntime
impl UnsafeUnpin for PyodideRuntime
impl UnwindSafe for PyodideRuntime
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> 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