Skip to main content

Crate armillae_simulate_bevy

Crate armillae_simulate_bevy 

Source
Expand description

Bevy ECS simulation backend for Armillae.

This crate adapts native Rust modules and clocks to the backend-neutral contracts owned by armillae-simulate. It intentionally exposes neither a main loop nor raw schedule ownership.

Native panics are converted to structured simulation failures when the process uses unwind panics. A binary built with panic = "abort" cannot recover at these boundaries.

World access is closure-scoped, so a borrow cannot escape the operation:

ⓘ
use armillae_simulate_bevy::BevySimulation;
use bevy_ecs::world::World;

fn leak_world(simulation: &BevySimulation) -> &World {
    simulation
        .inspect_world(|world| world)
        .expect("inspection succeeds")
}
ⓘ
use armillae_simulate_bevy::BevySimulation;
use bevy_ecs::world::World;

fn leak_world_mut(simulation: &mut BevySimulation) -> &mut World {
    simulation
        .write_world(|world| world)
        .expect("write succeeds")
}

A World borrow also cannot be held across an async suspension point:

ⓘ
use armillae_simulate_bevy::BevySimulation;

async fn hold_across_await(simulation: &BevySimulation) {
    simulation
        .inspect_world(|world| async move {
            std::future::ready(()).await;
            world.entities().len()
        })
        .expect("inspection succeeds")
        .await;
}

Structs§

AdvanceContext
BevyModuleRegistrar
BevySimulation
BevySimulationBuilder
ClockComponent
ExecuteContext

Enums§

ExecuteOutputError

Constants§

BEVY_BACKEND_ID
BEVY_ENGINE_NAME

Traits§

BevyModule