pub struct PageOffset(/* private fields */);Available on x86-64 only.
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) -> PageOffset
pub fn new(offset: u16) -> PageOffset
Creates a new offset from the given u16. Panics if the passed value is >=4096.
Sourcepub const fn new_truncate(offset: u16) -> PageOffset
pub const fn new_truncate(offset: u16) -> PageOffset
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 duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PageOffset
Source§impl Debug for PageOffset
impl Debug for PageOffset
impl Eq for PageOffset
Source§impl Hash for PageOffset
impl Hash for PageOffset
Source§impl Ord for PageOffset
impl Ord for PageOffset
Source§fn cmp(&self, other: &PageOffset) -> Ordering
fn cmp(&self, other: &PageOffset) -> Ordering
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for PageOffset
impl PartialEq for PageOffset
Source§impl PartialOrd for PageOffset
impl PartialOrd for PageOffset
impl StructuralPartialEq for PageOffset
Auto Trait Implementations§
impl Freeze for PageOffset
impl RefUnwindSafe for PageOffset
impl Send for PageOffset
impl Sync for PageOffset
impl Unpin for PageOffset
impl UnsafeUnpin for PageOffset
impl UnwindSafe for PageOffset
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