amethyst / amethyst/legion

Resources with a lifetime

Aperta
#259 1 commento 3 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
1.7k
Fork
140
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Currently `Resource`s must be `'static`, which makes it difficult to implement many functionalities as systems, notably rendering, since the textures / sprites / render contexts etc. usually have a lifetime associated with them.

My question is, is it possible to have resources that are generic over a lifetime parameter `'a` and have `Schedule::execute<'a>(&mut self, world: &mut World, resources: &'a mut Resource<'a>`? After all, resources are not accessed outside of this function. Or is there some reason against this?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.