Skip to main content

with_stepped_world_mut

Function with_stepped_world_mut 

Source
pub fn with_stepped_world_mut<R>(
    host: &World,
    entity: Entity,
    f: impl FnOnce(&mut World) -> R,
) -> Result<R, StepError>
Expand description

Run f against a stepped world’s world mutably.

The mutable twin of with_stepped_world: a caller that starts or stops a recording on the world needs the world itself, not only its components.

§Errors

Returns StepError::NoWorld when entity names no reachable world proxy, and StepError::NotStepped when it names a threaded world.