doc.rust-lang.org
pub const unsafe fn read_unaligned(self) -> T
Reads the value from self without moving it. This leaves the memory in self unchanged.
method
core
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn read(self) -> T
Reads the value from self without moving it. This leaves the memory in self unchanged.
method
core
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn offset_from_unsigned(self, origin: *const T) -> usize
Calculates the distance between two pointers within the same allocation, where it's known that self is equal to or greater than origin. The returned value is in units of T: the distance in bytes is divided by size_of::<T>().
method
core
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn offset_from(self, origin: *const T) -> isize
Calculates the distance between two pointers within the same allocation. The returned value is in units of T: the distance in bytes divided by size_of::<T>().
method
core
Stable since 1.47.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn offset(self, count: isize) -> *const T
Adds a signed offset to a pointer.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn map_addr(self, f: impl FnOnce(usize) -> usize) -> Self
Creates a new pointer by mapping self's address to a new one, preserving the provenance of self.
method
core
Stable since 1.84.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn len(self) -> usize
Returns the length of a raw slice.
method
core
Stable since 1.79.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_null(self) -> bool
Returns true if the pointer is null.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_empty(self) -> bool
Returns true if the raw slice has a length of 0.
method
core
Stable since 1.79.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_aligned(self) -> bool
Returns whether the pointer is properly aligned for T.
method
core
Stable since 1.79.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn expose_provenance(self) -> usize
Exposes the "provenance" part of the pointer for future use in with_exposed_provenance and returns the "address" portion.
method
core
Stable since 1.84.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn drop_in_place(self)
Executes the destructor (if any) of the pointed-to value.
method
core
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize)
Copies count * size_of::<T>() bytes from self to dest. The source and destination may not overlap.
method
core
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy_to(self, dest: *mut T, count: usize)
Copies count * size_of::<T>() bytes from self to dest. The source and destination may overlap.
method
core
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy_from_nonoverlapping(self, src: *const T, count: usize)
Copies count * size_of::<T>() bytes from src to self. The source and destination may not overlap.
method
core
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy_from(self, src: *const T, count: usize)
Copies count * size_of::<T>() bytes from src to self. The source and destination may overlap.
method
core
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn cast_mut(self) -> *mut T
Changes constness without changing the type.
method
core
Stable since 1.65.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn cast_const(self) -> *const T
Changes constness without changing the type.
method
core
Stable since 1.65.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn cast<U>(self) -> *const U
Casts to a pointer of another type.
method
core
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn byte_sub(self, count: usize) -> Self
Subtracts an unsigned offset in bytes from a pointer.
method
core
Stable since 1.75.0
Version 1.100.0-nightly