Skip to content
Rust Search
← Browse conferences

Bevy's immutable components: managing side effects in a parallel world

RustNL
RustWeek 28:54 4011 views

Alice Ivy Cecile -- Every now and then, Bevy users would ask for a simple helper: give me a way to mark a component on an entity as “read-only” so library authors could uphold invariants tied to the value of a public component. Unfortunately, there was a gaping hole: you could simply remove the component, mutate it and then reinsert it. But… wait. That reinsertion would trigger “lifecycle hooks”, a new feature that automatically respond to components’ insertion and removal. Suddenly, this broken

Player unavailable or embedding blocked? Use the YouTube link above.