#[repr(transparent)]pub struct uptr(_);
Expand description
A pointer that pretends to be an integer, for API Crimes.
Please don’t use this type.
If you can’t possibly satisfy strict provenance for whatever reason, you can at least use this type to make sure the compiler still understands that Pointers Are Happening.
All operations on this type will derive provenance from the left-hand-size (lhs).
So x + y
has x
’s provenance. Many operations are nonsensical if the pointer
inside is a real pointer, but hey, you’ve reached for the “I Know What I’m Doing”
lever, so we’ll let you say whatever gibberish you want.
Please submit a PR if you need some operation defined on usize to be exposed here.
Implementations
sourceimpl uptr
impl uptr
pub const MIN: uptr
pub const MAX: uptr
pub const BITS: u32
pub const fn from_int(val: usize) -> Self
pub const fn from_ptr_mut<T>(val: *mut T) -> Self
pub const fn from_ptr<T>(val: *const T) -> Self
pub const fn to_ptr(self) -> *mut ()
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_div(self, rhs: Self) -> Self
Trait Implementations
sourceimpl AddAssign<uptr> for uptr
impl AddAssign<uptr> for uptr
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation. Read more
sourceimpl BitAndAssign<uptr> for uptr
impl BitAndAssign<uptr> for uptr
sourcefn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the &=
operation. Read more
sourceimpl BitOrAssign<uptr> for uptr
impl BitOrAssign<uptr> for uptr
sourcefn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the |=
operation. Read more
sourceimpl BitXorAssign<uptr> for uptr
impl BitXorAssign<uptr> for uptr
sourcefn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the ^=
operation. Read more
sourceimpl DivAssign<uptr> for uptr
impl DivAssign<uptr> for uptr
sourcefn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the /=
operation. Read more
sourceimpl MulAssign<uptr> for uptr
impl MulAssign<uptr> for uptr
sourcefn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the *=
operation. Read more
sourceimpl Ord for uptr
impl Ord for uptr
sourceimpl PartialOrd<uptr> for uptr
impl PartialOrd<uptr> for uptr
sourcefn partial_cmp(&self, other: &uptr) -> Option<Ordering>
fn partial_cmp(&self, other: &uptr) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl RemAssign<uptr> for uptr
impl RemAssign<uptr> for uptr
sourcefn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the %=
operation. Read more
sourceimpl ShlAssign<usize> for uptr
impl ShlAssign<usize> for uptr
sourcefn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
Performs the <<=
operation. Read more
sourceimpl ShrAssign<usize> for uptr
impl ShrAssign<usize> for uptr
sourcefn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
Performs the >>=
operation. Read more
sourceimpl SubAssign<uptr> for uptr
impl SubAssign<uptr> for uptr
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the -=
operation. Read more
impl Copy for uptr
impl Eq for uptr
impl StructuralEq for uptr
impl StructuralPartialEq for uptr
Auto Trait Implementations
impl RefUnwindSafe for uptr
impl !Send for uptr
impl !Sync for uptr
impl Unpin for uptr
impl UnwindSafe for uptr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more