Struct x86_64::structures::paging::page_table::PageOffset
source · pub struct PageOffset(/* private fields */);
Expand description
A 12-bit offset into a 4KiB Page.
This type is returned by the VirtAddr::page_offset
method.
Guaranteed to only ever contain 0..4096.
Implementations§
source§impl PageOffset
impl PageOffset
sourcepub fn new(offset: u16) -> Self
pub fn new(offset: u16) -> Self
Creates a new offset from the given u16
. Panics if the passed value is >=4096.
sourcepub const fn new_truncate(offset: u16) -> Self
pub const fn new_truncate(offset: u16) -> Self
Creates a new offset from the given u16
. Throws away bits if the value is >=4096.
Trait Implementations§
source§impl Clone for PageOffset
impl Clone for PageOffset
source§fn clone(&self) -> PageOffset
fn clone(&self) -> PageOffset
Returns a copy of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PageOffset
impl Debug for PageOffset
source§impl From<PageOffset> for u16
impl From<PageOffset> for u16
source§fn from(offset: PageOffset) -> Self
fn from(offset: PageOffset) -> Self
Converts to this type from the input type.
source§impl From<PageOffset> for u32
impl From<PageOffset> for u32
source§fn from(offset: PageOffset) -> Self
fn from(offset: PageOffset) -> Self
Converts to this type from the input type.
source§impl From<PageOffset> for u64
impl From<PageOffset> for u64
source§fn from(offset: PageOffset) -> Self
fn from(offset: PageOffset) -> Self
Converts to this type from the input type.
source§impl From<PageOffset> for usize
impl From<PageOffset> for usize
source§fn from(offset: PageOffset) -> Self
fn from(offset: PageOffset) -> Self
Converts to this type from the input type.