diff --git a/src/memory/paging/table.rs b/src/memory/paging/table.rs index a6652b5..4ce7991 100644 --- a/src/memory/paging/table.rs +++ b/src/memory/paging/table.rs @@ -1,6 +1,21 @@ +use core::ops::{Index, IndexMut}; use memory::paging::entry::*; use memory::paging::ENTRY_COUNT; pub struct Table { entries: [Entry; ENTRY_COUNT], } + +impl Index for Table { + type Output = Entry; + + fn index(&self, index: usize) -> &Entry { + &self.entries[index] + } +} + +impl IndexMut for Table { + fn index_mut(&mut self, index: usize) -> &mut Entry { + &mut self.entries[index] + } +}