pub struct Frame<P = Page4K>where
P: PageSize,{ /* private fields */ }
Expand description
A Frame
is a chunk of physical memory aligned to a page boundary (default 4KiB) given by the P
parameter.
Implementations§
§impl Frame<Page4K>
impl Frame<Page4K>
pub const fn containing_address(addr: PhysicalAddress) -> Frame<Page4K>
pub const fn containing_address(addr: PhysicalAddress) -> Frame<Page4K>
Returns the 4KiB Frame
containing the given PhysicalAddress
.
pub const fn align_up(&self, alignment_4k_pages: usize) -> Frame<Page4K>
pub const fn align_up(&self, alignment_4k_pages: usize) -> Frame<Page4K>
Returns a new Frame
that is aligned up from this Frame
to the nearest multiple of alignment_4k_pages
.
pub const fn from_4k_into_generic<P>(self) -> Frame<P>where
P: PageSize,
pub const fn from_4k_into_generic<P>(self) -> Frame<P>where P: PageSize,
Converts a known 4K-sized Frame
into a
Frame<P>
with a generic PageSize
parameter.
§impl Frame<Page2M>
impl Frame<Page2M>
pub const fn containing_address_2mb(addr: PhysicalAddress) -> Frame<Page2M>
pub const fn containing_address_2mb(addr: PhysicalAddress) -> Frame<Page2M>
Returns the 2MiB huge Frame
containing the given PhysicalAddress
.
pub const fn from_2m_into_generic<P>(self) -> Frame<P>where
P: PageSize,
pub const fn from_2m_into_generic<P>(self) -> Frame<P>where P: PageSize,
Converts a known 2M-sized Frame
into a
Frame<P>
with a generic PageSize
parameter.
§impl Frame<Page1G>
impl Frame<Page1G>
pub const fn containing_address_1gb(addr: PhysicalAddress) -> Frame<Page1G>
pub const fn containing_address_1gb(addr: PhysicalAddress) -> Frame<Page1G>
Returns the 1GiB huge Frame
containing the given PhysicalAddress
.
pub const fn from_1g_into_generic<P>(self) -> Frame<P>where
P: PageSize,
pub const fn from_1g_into_generic<P>(self) -> Frame<P>where P: PageSize,
Converts a known 1G-sized Frame
into a
Frame<P>
with a generic PageSize
parameter.
§impl<P> Frame<P>where
P: PageSize,
impl<P> Frame<P>where P: PageSize,
pub const fn start_address(&self) -> PhysicalAddress
pub const fn start_address(&self) -> PhysicalAddress
Returns the PhysicalAddress
at the start of this Frame
.
pub const fn page_size(&self) -> MemChunkSize
pub const fn page_size(&self) -> MemChunkSize
Returns the size of this Frame
.
Trait Implementations§
§impl<P> AddAssign<usize> for Frame<P>where
P: PageSize,
impl<P> AddAssign<usize> for Frame<P>where P: PageSize,
§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+=
operation. Read more§impl<P> Ord for Frame<P>where
P: Ord + PageSize,
impl<P> Ord for Frame<P>where P: Ord + PageSize,
§impl<P> PartialOrd<Frame<P>> for Frame<P>where
P: PartialOrd<P> + PageSize,
impl<P> PartialOrd<Frame<P>> for Frame<P>where P: PartialOrd<P> + PageSize,
§fn partial_cmp(&self, other: &Frame<P>) -> Option<Ordering>
fn partial_cmp(&self, other: &Frame<P>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl<P> Step for Frame<P>where
P: PageSize,
impl<P> Step for Frame<P>where P: PageSize,
§fn steps_between(start: &Frame<P>, end: &Frame<P>) -> Option<usize>
fn steps_between(start: &Frame<P>, end: &Frame<P>) -> Option<usize>
🔬This is a nightly-only experimental API. (
step_trait
)§fn forward_checked(start: Frame<P>, count: usize) -> Option<Frame<P>>
fn forward_checked(start: Frame<P>, count: usize) -> Option<Frame<P>>
🔬This is a nightly-only experimental API. (
step_trait
)§fn backward_checked(start: Frame<P>, count: usize) -> Option<Frame<P>>
fn backward_checked(start: Frame<P>, count: usize) -> Option<Frame<P>>
🔬This is a nightly-only experimental API. (
step_trait
)source§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)source§unsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)source§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)source§unsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)§impl<P> SubAssign<usize> for Frame<P>where
P: PageSize,
impl<P> SubAssign<usize> for Frame<P>where P: PageSize,
§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
Performs the
-=
operation. Read moreimpl<P> Copy for Frame<P>where P: Copy + PageSize,
impl<P> Eq for Frame<P>where P: Eq + PageSize,
impl<P> StructuralEq for Frame<P>where P: PageSize,
impl<P> StructuralPartialEq for Frame<P>where P: PageSize,
Auto Trait Implementations§
impl<P> RefUnwindSafe for Frame<P>where P: RefUnwindSafe,
impl<P> Send for Frame<P>where P: Send,
impl<P> Sync for Frame<P>where P: Sync,
impl<P> Unpin for Frame<P>where P: Unpin,
impl<P> UnwindSafe for Frame<P>where P: UnwindSafe,
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