rust-vmm / vm-memory

Virtual machine's guest memory crate
Apache License 2.0
299 stars 97 forks source link

[RFC] Remove `GuestMemoryIterator`, replace with GAT #278

Open roypat opened 7 months ago

roypat commented 7 months ago

Use an implicit generic associated type to realize GuestMemory::iter(). This removes the pre-GAT workaround used here to get an iterator that borrows values with the same lifetime as the &self parameter to .iter().

This is a follow up from a discussion between @Ablu and me on Slack. I was cleaning up my workspace and decided to just put it out here to get some comments. Note that this requires rustc 1.75.0 to compile, so it might not be something we want to do in the near future.

Requirements

Before submitting your PR, please make sure you addressed the following requirements: