pub struct uptr(/* private fields */);
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§
Source§impl uptr
impl uptr
pub const MIN: uptr
pub const MAX: uptr
pub const BITS: u32 = 64u32
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§
Source§impl AddAssign for uptr
impl AddAssign for uptr
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl BitAndAssign for uptr
impl BitAndAssign for uptr
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moreSource§impl BitOrAssign for uptr
impl BitOrAssign for uptr
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moreSource§impl BitXorAssign for uptr
impl BitXorAssign for uptr
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moreSource§impl DivAssign for uptr
impl DivAssign for uptr
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moreSource§impl MulAssign for uptr
impl MulAssign for uptr
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moreSource§impl Ord for uptr
impl Ord for uptr
Source§impl PartialOrd for uptr
impl PartialOrd for uptr
Source§impl RemAssign for uptr
impl RemAssign for uptr
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moreSource§impl ShlAssign<usize> for uptr
impl ShlAssign<usize> for uptr
Source§fn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
Performs the
<<=
operation. Read moreSource§impl ShrAssign<usize> for uptr
impl ShrAssign<usize> for uptr
Source§fn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
Performs the
>>=
operation. Read moreSource§impl SubAssign for uptr
impl SubAssign for uptr
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreimpl Copy for uptr
impl Eq for uptr
impl StructuralPartialEq for uptr
Auto Trait Implementations§
impl Freeze for uptr
impl RefUnwindSafe for uptr
impl !Send for uptr
impl !Sync for uptr
impl Unpin for uptr
impl UnwindSafe for uptr
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