Open Pranz opened 10 years ago
So, what I'm thinking is that you have lists containing values of individual components of an object, updater, renderer, event handler. These are of definite size, and in them you can have a boxed Rc of it's parent object. I think this works?
Game<'a>:
updatables : Vec<Updater<Any,'a>>
Updater<T,'a>:
myval : Box<Rc<T>>
update : |&mut 'a T|:'a
The problem: We need to have a lot of references to a lot of data. Nearly all objects
needwill be designed in mind for mutability. We can't have a mutable reference and simultaneously have immutable (active) references. Rust has support for this, but nearly everything that is good requires sized types. The solution: