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.
Trait Implementations§
Source§impl Debug for RuntimeContext
impl Debug for RuntimeContext
Source§impl Default for RuntimeContext
impl Default for RuntimeContext
Source§fn default() -> RuntimeContext
fn default() -> RuntimeContext
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeContext
impl !UnwindSafe for RuntimeContext
impl Freeze for RuntimeContext
impl Send for RuntimeContext
impl Sync for RuntimeContext
impl Unpin for RuntimeContext
impl UnsafeUnpin for RuntimeContext
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
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> 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>
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>
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