pub struct Runtime { /* private fields */ }Expand description
Owns one simulation’s host from source binding through execution.
Install Self::host in dive_model::BindOptions before binding, then
execute with this same runtime. Startup and reached random operations share
one stream; the simulator never restarts a caller’s partially consumed RNG.
A runtime admits one execution, including failed/cancelled executions.
Run execution on a thread with dive_eval::RECOMMENDED_STACK.
use dive_sim::{Options, Runtime};
use dive_stdlib::random::RandomMode;
let runtime = Runtime::new(Options::new(7, RandomMode::Dive, 100, 10));
let binding = dive_model::BindOptions { host: Some(runtime.host()), ..Default::default() };
assert!(binding.host.is_some());
// Bind the source with `binding`, then run a backend with
// `runtime.simulate_with_backend`.Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new(options: Options) -> Self
pub fn new(options: Options) -> Self
Creates the run context before source binding or startup evaluation.
Sourcepub fn set_config(&self, config: Option<RunConfig>)
pub fn set_config(&self, config: Option<RunConfig>)
Supplies the actual bound configuration after startup binding finishes. Configuration remains unavailable during binding, as in ordinary TLC.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl !UnwindSafe for Runtime
impl Forget for Runtime
impl Move for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
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
Mutably borrows from an owned value. Read more