Module core::ptr1.0.0 [−] [src]

Raw, unsafe pointers, *const T, and *mut T.

See also the pointer primitive types.

Reexports

pub use intrinsics::copy_nonoverlapping;
pub use intrinsics::copy;
pub use intrinsics::write_bytes;

Structs

Shared [
Experimental
]

A wrapper around a raw *mut T that indicates that the possessor of this wrapper has shared ownership of the referent. Useful for building abstractions like Rc<T>, Arc<T>, or doubly-linked lists, which internally use aliased raw pointers to manage the memory that they own.

Unique [
Experimental
]

A wrapper around a raw non-null *mut T that indicates that the possessor of this wrapper owns the referent. Useful for building abstractions like Box<T>, Vec<T>, String, and HashMap<K, V>.

Functions

drop_in_place⚠

Executes the destructor (if any) of the pointed-to value.

eq

Compare raw pointers for equality.

null

Creates a null raw pointer.

null_mut

Creates a null mutable raw pointer.

read⚠

Reads the value from src without moving it. This leaves the memory in src unchanged.

read_unaligned⚠

Reads the value from src without moving it. This leaves the memory in src unchanged.

read_volatile⚠

Performs a volatile read of the value from src without moving it. This leaves the memory in src unchanged.

replace⚠

Replaces the value at dest with src, returning the old value, without dropping either.

swap⚠

Swaps the values at two mutable locations of the same type, without deinitializing either. They may overlap, unlike mem::swap which is otherwise equivalent.

write⚠

Overwrites a memory location with the given value without reading or dropping the old value.

write_unaligned⚠

Overwrites a memory location with the given value without reading or dropping the old value.

write_volatile⚠

Performs a volatile write of a memory location with the given value without reading or dropping the old value.