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 duplicate of the value. Read more
1.0.0 (const: unstable)§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 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.
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)§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 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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)