pub struct Handle<'mapper, S: Size, E: PageFlags<S>> { /* private fields */ }
Expand description
A page in the process of being remapped.
This reference allows updating page table flags prior to committing changes.
Implementations§
source§impl<'mapper, S, E> Handle<'mapper, S, E>
impl<'mapper, S, E> Handle<'mapper, S, E>
pub fn new(page: Page<VAddr, S>, entry: &'mapper mut E) -> Self
sourcepub fn virt_page(&self) -> &Page<VAddr, S>
pub fn virt_page(&self) -> &Page<VAddr, S>
Returns the virtual page this entry is currently mapped to.
sourcepub unsafe fn set_writable(self, writable: bool) -> Self
pub unsafe fn set_writable(self, writable: bool) -> Self
Set whether or not this page is writable.
Safety
Manual control of page flags can be used to violate Rust invariants.
Using set_writable
to make memory that the Rust compiler expects to be
read-only may cause undefined behavior. Making a page which is aliased
page table (i.e. it has multiple page table entries pointing to it) may
also cause undefined behavior.
sourcepub unsafe fn set_executable(self, executable: bool) -> Self
pub unsafe fn set_executable(self, executable: bool) -> Self
Set whether or not this page is executable.
Safety
Manual control of page flags can be used to violate Rust invariants.
Using set_executable
to make writable memory executable may cause
undefined behavior. Also, this can be used to execute the contents of
arbitrary memory, which (of course) is wildly unsafe.
sourcepub unsafe fn set_present(self, present: bool) -> Self
pub unsafe fn set_present(self, present: bool) -> Self
Set whether or not this page is present.
Safety
Manual control of page flags can be used to violate Rust invariants.