Skip to main content

ParticleEmitter

Trait ParticleEmitter 

Source
pub trait ParticleEmitter: Send + Sync {
    // Required method
    fn emit(
        &self,
        step: u64,
        time: Time,
        random: &mut Random,
        output: &mut Vec<Particle>,
    ) -> Result<(), ValidationError>;

    // Provided method
    fn accepts_event(&self, _: &ParticleEvent) -> bool { ... }
}
Expand description

Fixed-step emitter. Callbacks are deterministic and cooperative: output is bounded after return, not a hard allocator sandbox. IDs/age are assigned by the simulation. Random streams are keyed per emitter and step.

Required Methods§

Source

fn emit( &self, step: u64, time: Time, random: &mut Random, output: &mut Vec<Particle>, ) -> Result<(), ValidationError>

Appends births at this exact fixed-step boundary.

Provided Methods§

Source

fn accepts_event(&self, _: &ParticleEvent) -> bool

Filters event-triggered births. Root emission is unaffected; ordinary emitters accept all events.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§