Struct PageOffset
pub struct PageOffset(u16);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.
Tuple Fields§
§0: u16Implementations§
§impl PageOffset
impl PageOffset
pub 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.
pub 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§
§impl Clone for PageOffset
impl Clone for PageOffset
§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
§impl Debug for PageOffset
impl Debug for PageOffset
impl Eq for PageOffset
§impl Hash for PageOffset
impl Hash for PageOffset
§impl Ord for PageOffset
impl Ord for PageOffset
§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
§impl PartialEq for PageOffset
impl PartialEq for PageOffset
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more