specs
specs copied to clipboard
Add way of getting multiple mutable references from storages
Add API that allows getting multiple mutable references from a storage in a way that preserves correctness. If we had integer generics we could provide generic API:
fn get_muts<const N: usize>(&mut self, [Entity; N]) -> Option<[&mut T; N]>;
Right now we could provide more specific instances of it.
The API should be restricted to DistinctStorages and should check that parameter indices are different.
Should we also add API for getting multiple entries?
Actually, DistinctStorage is one part of the API that I'm not so sure about. We don't know if in the future Rust still permits this hack.
That would be shame.. It would basically destroy any chance of reusing any storages for parallel iteration.
Well, I think we could still make it work with VecStorage and DenseVecStorage.
@mjadczak May I add your source code (the roboter following the other one) here so that we have a real-world example?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant.
Hey @torkleyy , I hadn't noticed your comment until now. I don't know if this is still relevant / helpful, but the relevant code is here - I have to collect up all the changes I want to apply and only then apply them.
Thanks @mjadczak! I'm still looking for a good solution here.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant.
Commenting to keep open (presumably hasn't been solved yet)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant.
Ditto?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant.