#[repr(C)]pub struct PhysFrame<S: PageSize = Size4KiB> { /* private fields */ }
Expand description
A physical memory frame.
Implementations§
Source§impl<S: PageSize> PhysFrame<S>
impl<S: PageSize> PhysFrame<S>
Sourcepub fn from_start_address(address: PhysAddr) -> Result<Self, AddressNotAligned>
pub fn from_start_address(address: PhysAddr) -> Result<Self, AddressNotAligned>
Returns the frame that starts at the given virtual address.
Returns an error if the address is not correctly aligned (i.e. is not a valid frame start).
Sourcepub const unsafe fn from_start_address_unchecked(
start_address: PhysAddr,
) -> Self
pub const unsafe fn from_start_address_unchecked( start_address: PhysAddr, ) -> Self
Returns the frame that starts at the given virtual address.
§Safety
The address must be correctly aligned.
Sourcepub fn containing_address(address: PhysAddr) -> Self
pub fn containing_address(address: PhysAddr) -> Self
Returns the frame that contains the given physical address.
Sourcepub const fn start_address(self) -> PhysAddr
pub const fn start_address(self) -> PhysAddr
Returns the start address of the frame.
Sourcepub const fn range(start: PhysFrame<S>, end: PhysFrame<S>) -> PhysFrameRange<S> ⓘ
pub const fn range(start: PhysFrame<S>, end: PhysFrame<S>) -> PhysFrameRange<S> ⓘ
Returns a range of frames, exclusive end
.
Sourcepub const fn range_inclusive(
start: PhysFrame<S>,
end: PhysFrame<S>,
) -> PhysFrameRangeInclusive<S> ⓘ
pub const fn range_inclusive( start: PhysFrame<S>, end: PhysFrame<S>, ) -> PhysFrameRangeInclusive<S> ⓘ
Returns a range of frames, inclusive end
.
Trait Implementations§
Source§impl<S: PageSize> AddAssign<u64> for PhysFrame<S>
impl<S: PageSize> AddAssign<u64> for PhysFrame<S>
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+=
operation. Read moreSource§impl<S: Ord + PageSize> Ord for PhysFrame<S>
impl<S: Ord + PageSize> Ord for PhysFrame<S>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<S: PartialOrd + PageSize> PartialOrd for PhysFrame<S>
impl<S: PartialOrd + PageSize> PartialOrd for PhysFrame<S>
Source§impl<S: PageSize> SubAssign<u64> for PhysFrame<S>
impl<S: PageSize> SubAssign<u64> for PhysFrame<S>
Source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
Performs the
-=
operation. Read moreimpl<S: Copy + PageSize> Copy for PhysFrame<S>
impl<S: Eq + PageSize> Eq for PhysFrame<S>
impl<S: PageSize> StructuralPartialEq for PhysFrame<S>
Auto Trait Implementations§
impl<S> Freeze for PhysFrame<S>
impl<S> RefUnwindSafe for PhysFrame<S>where
S: RefUnwindSafe,
impl<S> Send for PhysFrame<S>where
S: Send,
impl<S> Sync for PhysFrame<S>where
S: Sync,
impl<S> Unpin for PhysFrame<S>where
S: Unpin,
impl<S> UnwindSafe for PhysFrame<S>where
S: 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