pub struct RuntimeContext { /* private fields */ }Expand description
Process-global runtime handle shared by all database regions.
Implementations§
Source§impl RuntimeContext
impl RuntimeContext
Sourcepub fn new(config: RuntimeConfig) -> RuntimeContext
pub fn new(config: RuntimeConfig) -> RuntimeContext
Create a runtime context with the provided configuration.
This constructor always creates a cancellation-detached FrankenSQLite
root Cx, even when invoked from within an active asupersync task.
Call Self::new_with_root_cx when the caller already owns the
canonical parent Cx and wants explicit capability lineage.
Sourcepub fn new_with_root_cx(config: RuntimeConfig, root_cx: &Cx) -> RuntimeContext
pub fn new_with_root_cx(config: RuntimeConfig, root_cx: &Cx) -> RuntimeContext
Create a runtime context rooted in a caller-supplied parent Cx.
This keeps capability lineage attached to the caller’s budget, cancellation state, and native asupersync context instead of minting a disconnected root inside FrankenSQLite.
Sourcepub const fn runtime_id(&self) -> u64
pub const fn runtime_id(&self) -> u64
Return the stable runtime identity used to isolate per-database state.
Sourcepub const fn config(&self) -> &RuntimeConfig
pub const fn config(&self) -> &RuntimeConfig
Access the runtime configuration.
Sourcepub fn global() -> Arc<RuntimeContext>
pub fn global() -> Arc<RuntimeContext>
Return the active process-global runtime context.