pub struct BehaviorSystem { /* private fields */ }Expand description
Runs a world’s Behavior components: their firing rules, their bodies,
and the effects those produce.
new evaluates every run on the calling thread and
persists nothing; a host lends it a thread pool through
with_scheduler and somewhere to keep
state through with_store.
Implementations§
Source§impl BehaviorSystem
impl BehaviorSystem
Sourcepub fn with_store(self, store: Box<dyn BehaviorStore>) -> Self
pub fn with_store(self, store: Box<dyn BehaviorStore>) -> Self
Keep this world’s variables and once flags in store.
Sourcepub fn with_scheduler(self, scheduler: Box<dyn EvalScheduler>) -> Self
pub fn with_scheduler(self, scheduler: Box<dyn EvalScheduler>) -> Self
Fan a tick’s evaluation out through scheduler once enough instances
fire at once to pay for it.
Trait Implementations§
Source§impl Debug for BehaviorSystem
impl Debug for BehaviorSystem
Source§impl Default for BehaviorSystem
impl Default for BehaviorSystem
Source§fn default() -> BehaviorSystem
fn default() -> BehaviorSystem
Returns the “default value” for a type. Read more
Source§impl System for BehaviorSystem
impl System for BehaviorSystem
Source§fn init(&mut self, ctx: &mut PipelineContext<'_>)
fn init(&mut self, ctx: &mut PipelineContext<'_>)
Run once at
World::start, before the first step.Source§fn step(&mut self, ctx: &mut PipelineContext<'_>) -> StepResult
fn step(&mut self, ctx: &mut PipelineContext<'_>) -> StepResult
Run once per tick.
Source§fn access(&self) -> Access
fn access(&self) -> Access
The data
step may touch, consulted once when the schedule is built
(after init, so a data-dependent system can compute it from its
compiled state). The default claims everything: an undeclared system is
ordered against all others and never runs concurrently, which is always
safe. Declaring narrower access is what admits a system to shared waves
and to debug-build access validation.Auto Trait Implementations§
impl !RefUnwindSafe for BehaviorSystem
impl !Sync for BehaviorSystem
impl !UnwindSafe for BehaviorSystem
impl Freeze for BehaviorSystem
impl Send for BehaviorSystem
impl Unpin for BehaviorSystem
impl UnsafeUnpin for BehaviorSystem
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