File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 22
33use super :: * ;
44use core:: fmt:: Debug ;
5+ use core:: ops:: { Index , IndexMut } ;
56
67/// An accessory to the UEFI memory map and associated metadata that can be
78/// either iterated or indexed like an array.
@@ -25,7 +26,7 @@ use core::fmt::Debug;
2526/// a low level.
2627///
2728/// [0]: https://github.com/tianocore/edk2/blob/7142e648416ff5d3eac6c6d607874805f5de0ca8/MdeModulePkg/Core/PiSmmCore/Page.c#L1059
28- pub trait MemoryMap : Debug {
29+ pub trait MemoryMap : Debug + Index < usize , Output = MemoryDescriptor > {
2930 // TODO also require IntoIterator?! :)
3031
3132 /// Returns the associated [`MemoryMapMeta`].
@@ -73,7 +74,7 @@ pub trait MemoryMap: Debug {
7374
7475/// Extension to [`MemoryMap`] that adds mutable operations. This also includes
7576/// the ability to sort the memory map.
76- pub trait MemoryMapMut : MemoryMap {
77+ pub trait MemoryMapMut : MemoryMap + IndexMut < usize > {
7778 /// Returns a mutable reference to the [`MemoryDescriptor`] at the given
7879 /// index, if present.
7980 #[ must_use]
You can’t perform that action at this time.
0 commit comments