pub struct MappedPageBox { /* private fields */ }Expand description
A range of pages that is mapped for as long as this box is alive.
Implementations§
Source§impl MappedPageBox
impl MappedPageBox
Sourcepub fn new(
layout: PageLayout,
flags: PageTableEntryFlags,
) -> Result<Self, AllocError>
pub fn new( layout: PageLayout, flags: PageTableEntryFlags, ) -> Result<Self, AllocError>
Allocates the pages and frames described by layout and maps them.
Sourcepub unsafe fn map_phys(
phys_addr: PhysAddr,
layout: PageLayout,
flags: PageTableEntryFlags,
) -> Result<Self, AllocError>
pub unsafe fn map_phys( phys_addr: PhysAddr, layout: PageLayout, flags: PageTableEntryFlags, ) -> Result<Self, AllocError>
Allocates the pages described by layout and maps them to phys_addr.
§Safety
- The frames at
phys_addrmust not be deallocated while the returned box is alive.
pub fn pages(&self) -> &PageRange
Trait Implementations§
Source§impl Drop for MappedPageBox
impl Drop for MappedPageBox
Auto Trait Implementations§
impl Freeze for MappedPageBox
impl RefUnwindSafe for MappedPageBox
impl Send for MappedPageBox
impl Sync for MappedPageBox
impl Unpin for MappedPageBox
impl UnsafeUnpin for MappedPageBox
impl UnwindSafe for MappedPageBox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more