pub struct InsideBlockEffectCollector {
effects_in_step: [bool; 5],
before_effects_in_step: [Vec<InsideBlockEffectCallback>; 5],
after_effects_in_step: [Vec<InsideBlockEffectCallback>; 5],
final_effects: Vec<InsideBlockEffectCallback>,
last_step: i32,
}Expand description
Step-scoped collector for vanilla inside-block side effects.
Vanilla lets blocks enqueue effects while the movement trace is still scanning intersections, then flushes those effects in a stable per-step order after the scan.
Fields§
§effects_in_step: [bool; 5]§before_effects_in_step: [Vec<InsideBlockEffectCallback>; 5]§after_effects_in_step: [Vec<InsideBlockEffectCallback>; 5]§final_effects: Vec<InsideBlockEffectCallback>§last_step: i32Implementations§
Source§impl InsideBlockEffectCollector
impl InsideBlockEffectCollector
Sourcepub fn advance_step(&mut self, step: i32)
pub fn advance_step(&mut self, step: i32)
Advances to a new block-trace step, flushing the previous step.
Sourcepub const fn apply(&mut self, effect_type: InsideBlockEffectType)
pub const fn apply(&mut self, effect_type: InsideBlockEffectType)
Queues a vanilla inside-block effect kind for the current step.
Sourcepub fn run_before(
&mut self,
effect_type: InsideBlockEffectType,
effect: InsideBlockEffectCallback,
)
pub fn run_before( &mut self, effect_type: InsideBlockEffectType, effect: InsideBlockEffectCallback, )
Queues a callback to run before this effect kind in the current step.
Sourcepub fn run_after(
&mut self,
effect_type: InsideBlockEffectType,
effect: InsideBlockEffectCallback,
)
pub fn run_after( &mut self, effect_type: InsideBlockEffectType, effect: InsideBlockEffectCallback, )
Queues a callback to run after this effect kind in the current step.
Sourcepub fn apply_and_clear(&mut self, entity: &dyn Entity)
pub fn apply_and_clear(&mut self, entity: &dyn Entity)
Applies queued effects and resets the collector for the next scan.
fn flush_step(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for InsideBlockEffectCollector
impl !UnwindSafe for InsideBlockEffectCollector
impl Freeze for InsideBlockEffectCollector
impl Send for InsideBlockEffectCollector
impl Sync for InsideBlockEffectCollector
impl Unpin for InsideBlockEffectCollector
impl UnsafeUnpin for InsideBlockEffectCollector
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>