pub struct PyRuntimeConfig {
pub pyodide_version: String,
pub pyodide_package_dir: Option<PathBuf>,
pub default_language: RuntimeLanguage,
pub snapshot: SnapshotConfig,
pub hooks: HostHooks,
pub budget_override: Option<InvocationLimits>,
pub reset_policy: ResetPolicy,
pub host_capabilities: Vec<String>,
pub warm_state: Option<WarmState>,
}Expand description
Configuration applied when constructing PyRuntime or pool members.
Fields§
§pyodide_version: StringBundled Pyodide version string (usually derived from build-time assets).
pyodide_package_dir: Option<PathBuf>Filesystem directory used to resolve Pyodide wheel and metadata requests.
When the crate is compiled with the full-pyodide-packages feature this defaults to the
build-script managed cache extracted into OUT_DIR. Hosts can override it programmatically
to avoid relying on process-wide environment variables.
default_language: RuntimeLanguageDefault guest language selected when manifests/descriptors omit one.
snapshot: SnapshotConfigSnapshot-related configuration.
hooks: HostHooksHost lifecycle hooks executed around warm snapshot capture/restore.
budget_override: Option<InvocationLimits>Optional global budget override applied to every session.
reset_policy: ResetPolicyRuntime reset behaviour after each invocation.
host_capabilities: Vec<String>Host capabilities enabled for exposed native APIs.
warm_state: Option<WarmState>Optional prebuilt warm state (snapshot + overlay).
Implementations§
Source§impl PyRuntimeConfig
impl PyRuntimeConfig
Sourcepub fn pyodide_package_dir(&self) -> Option<&PathBuf>
pub fn pyodide_package_dir(&self) -> Option<&PathBuf>
Returns the configured Pyodide package directory, if any.
Sourcepub fn set_pyodide_package_dir<P: Into<PathBuf>>(&mut self, path: P)
pub fn set_pyodide_package_dir<P: Into<PathBuf>>(&mut self, path: P)
Sets the Pyodide package directory override.
Sourcepub fn clear_pyodide_package_dir(&mut self)
pub fn clear_pyodide_package_dir(&mut self)
Clears any explicit Pyodide package directory override.
Sourcepub fn with_pyodide_package_dir<P: Into<PathBuf>>(self, path: P) -> Self
pub fn with_pyodide_package_dir<P: Into<PathBuf>>(self, path: P) -> Self
Returns a new configuration with the provided Pyodide package directory.
Sourcepub fn without_pyodide_package_dir(self) -> Self
pub fn without_pyodide_package_dir(self) -> Self
Returns a new configuration without an explicit Pyodide package directory override.
Trait Implementations§
Source§impl Clone for PyRuntimeConfig
impl Clone for PyRuntimeConfig
Source§fn clone(&self) -> PyRuntimeConfig
fn clone(&self) -> PyRuntimeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more