rj00a / evenio

An event-driven Entity Component System
MIT License
132 stars 14 forks source link

Non-'static Events #41

Closed kuviman closed 5 months ago

kuviman commented 5 months ago

Currently Events have a 'static requirement, but it seems to me that, when sent from outside the world (outside the event handlers) - using world.send(event), that event will only live until all the handlers have worked.

My usecase is basically rendering the world, but I only have a mutable reference to the rendering buffer, so I would like to have something like

#[derive(Event)]
struct Draw<'a> {
    framebuffer: &'a mut Framebuffer,
}