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§
Structs§
- Default
Runtime Guard - Guard returned by
set_default_runtime.
Enums§
- Runtime
Context - 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
fwith the default runtime context. - with_
runtime - Runs
fwith an explicitly supplied runtime installed for the duration of the closure.