Crate tenferro_internal_runtime

Crate tenferro_internal_runtime 

Source
Expand description

Internal shared runtime holder for tenferro surface crates.

§Examples

use tenferro_internal_runtime::{set_default_runtime, with_default_runtime, RuntimeContext};
use tenferro_prims::CpuContext;

let _guard = set_default_runtime(RuntimeContext::Cpu(CpuContext::new(1)));
let name = with_default_runtime(|ctx| Ok(ctx.name())).unwrap();
assert_eq!(name, "cpu");

Modules§

contracts
Hidden runtime contract aliases shared by tenferro frontend crates.
dispatch

Structs§

DefaultRuntimeGuard
Guard returned by set_default_runtime.

Enums§

RuntimeContext
Runtime execution context used by builder .run() entry points.

Functions§

set_default_runtime
Sets the default runtime context for builder .run().
with_default_runtime
Runs f with the default runtime context.
with_runtime
Runs f with an explicitly supplied runtime installed for the duration of the closure.