#[repr(transparent)]pub struct iptr(_);
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 isize to be exposed here.
Implementations
sourceimpl iptr
impl iptr
pub const MIN: iptr = Self::from_int(core::isize::MIN)
pub const MAX: iptr = Self::from_int(core::isize::MAX)
pub const BITS: u32 = 64u32
pub const fn from_int(val: isize) -> 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<iptr> for iptr
impl AddAssign<iptr> for iptr
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation. Read more
sourceimpl BitAndAssign<iptr> for iptr
impl BitAndAssign<iptr> for iptr
sourcefn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the &=
operation. Read more
sourceimpl BitOrAssign<iptr> for iptr
impl BitOrAssign<iptr> for iptr
sourcefn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the |=
operation. Read more
sourceimpl BitXorAssign<iptr> for iptr
impl BitXorAssign<iptr> for iptr
sourcefn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the ^=
operation. Read more
sourceimpl DivAssign<iptr> for iptr
impl DivAssign<iptr> for iptr
sourcefn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the /=
operation. Read more
sourceimpl MulAssign<iptr> for iptr
impl MulAssign<iptr> for iptr
sourcefn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the *=
operation. Read more
sourceimpl Ord for iptr
impl Ord for iptr
sourceimpl PartialOrd<iptr> for iptr
impl PartialOrd<iptr> for iptr
sourcefn partial_cmp(&self, other: &iptr) -> Option<Ordering>
fn partial_cmp(&self, other: &iptr) -> 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<iptr> for iptr
impl RemAssign<iptr> for iptr
sourcefn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the %=
operation. Read more
sourceimpl ShlAssign<usize> for iptr
impl ShlAssign<usize> for iptr
sourcefn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
Performs the <<=
operation. Read more
sourceimpl ShrAssign<usize> for iptr
impl ShrAssign<usize> for iptr
sourcefn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
Performs the >>=
operation. Read more
sourceimpl SubAssign<iptr> for iptr
impl SubAssign<iptr> for iptr
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the -=
operation. Read more
impl Copy for iptr
impl Eq for iptr
impl StructuralEq for iptr
impl StructuralPartialEq for iptr
Auto Trait Implementations
impl RefUnwindSafe for iptr
impl !Send for iptr
impl !Sync for iptr
impl Unpin for iptr
impl UnwindSafe for iptr
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