doc.rust-lang.org
pub fn align_offset(self, align: usize) -> usize
Computes the offset that needs to be applied to the pointer in order to make it aligned to align.
method
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn addr(self) -> NonZero<usize>
Gets the "address" portion of the pointer.
method
core
Stable since 1.84.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn add(self, count: usize) -> Self
Adds an unsigned offset to a pointer.
method
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct NonNull<T>
*mut T but non-zero and covariant.
struct
core
Stable since 1.25.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn hash<T, S>(hashee: *const T, into: &mut S)
Hash a raw pointer.
function
core
Stable since 1.35.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_ref<T>(r: &T) -> *const T
Converts a reference to a raw pointer.
function
core
Stable since 1.76.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_mut<T>(r: &mut T) -> *mut T
Converts a mutable reference to a raw pointer.
function
core
Stable since 1.76.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn fn_addr_eq<T, U>(f: T, g: U) -> bool
Compares the addresses of the two function pointers for equality.
function
core
Stable since 1.85.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn eq<T>(a: *const T, b: *const T) -> bool
Compares raw pointers for equality.
function
core
Stable since 1.17.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn drop_in_place<T>(to_drop: *mut T)
Executes the destructor (if any) of the pointed-to value.
function
core
Stable since 1.8.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn dangling_mut<T>() -> *mut T
Creates a new pointer that is dangling, but non-null and well-aligned.
function
core
Stable since 1.84.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn dangling<T>() -> *const T
Creates a new pointer that is dangling, but non-null and well-aligned.
function
core
Stable since 1.84.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize)
Copies count * size_of::<T>() bytes from src to dst. The source and destination must not overlap.
function
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize)
Copies count * size_of::<T>() bytes from src to dst. The source and destination may overlap.
function
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub macro addr_of_mut!
Creates a mut raw pointer to a place, without creating an intermediate reference.
macro
core
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub macro addr_of!
Creates a const raw pointer to a place, without creating an intermediate reference.
macro
core
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn addr_eq<T, U>(p: *const T, q: *const U) -> bool
Compares the addresses of the two pointers for equality, ignoring any metadata in fat pointers.
function
core
Stable since 1.76.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod ptr
Manually manage memory through raw pointers.
module
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod primitive
This module reexports the primitive types to allow usage that is not possibly shadowed by other declared types.
module
core
Stable since 1.43.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod v1
The first version of the core prelude.
module
core
Stable since 1.4.0
Version 1.100.0-nightly