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