Module no_std_compat2::ptr
source · Available on non-crate feature
std only.Macros
- Create a
constraw pointer to a place, without creating an intermediate reference. - Create a
mutraw pointer to a place, without creating an intermediate reference.
Structs
- AlignmentExperimentalA type storing a
usizewhich is a power of two, and thus represents a possible alignment in the rust abstract machine. - DynMetadataExperimentalThe metadata for a
Dyn = dyn SomeTraittrait object type. *mut Tbut non-zero and covariant.
Traits
- PointeeExperimentalProvides the pointer metadata type of any pointed-to type.
Functions
- from_exposed_addrExperimentalConvert an address back to a pointer, picking up a previously ‘exposed’ provenance.
- from_exposed_addr_mutExperimentalConvert an address back to a mutable pointer, picking up a previously ‘exposed’ provenance.
- from_mutExperimentalConvert a mutable reference to a raw pointer.
- from_raw_partsExperimentalForms a (possibly-wide) raw pointer from a data address and metadata.
- from_raw_parts_mutExperimentalPerforms the same functionality as
from_raw_parts, except that a raw*mutpointer is returned, as opposed to a raw*constpointer. - from_refExperimentalConvert a reference to a raw pointer.
- invalidExperimentalCreates an invalid pointer with the given address.
- invalid_mutExperimentalCreates an invalid mutable pointer with the given address.
- metadataExperimentalExtract the metadata component of a pointer.
- copy⚠Copies
count * size_of::<T>()bytes fromsrctodst. The source and destination may overlap. - Copies
count * size_of::<T>()bytes fromsrctodst. The source and destination must not overlap. - Executes the destructor (if any) of the pointed-to value.
- Compares raw pointers for equality.
- Hash a raw pointer.
- Creates a null raw pointer.
- Creates a null mutable raw pointer.
- read⚠Reads the value from
srcwithout moving it. This leaves the memory insrcunchanged. - Reads the value from
srcwithout moving it. This leaves the memory insrcunchanged. - Performs a volatile read of the value from
srcwithout moving it. This leaves the memory insrcunchanged. - Moves
srcinto the pointeddst, returning the previousdstvalue. - Forms a raw slice from a pointer and a length.
- Performs the same functionality as
slice_from_raw_parts, except that a raw mutable slice is returned, as opposed to a raw immutable slice. - swap⚠Swaps the values at two mutable locations of the same type, without deinitializing either.
- Swaps
count * size_of::<T>()bytes between the two regions of memory beginning atxandy. The two regions must not overlap. - Overwrites a memory location with the given value without reading or dropping the old value.
- Sets
count * size_of::<T>()bytes of memory starting atdsttoval. - Overwrites a memory location with the given value without reading or dropping the old value.
- Performs a volatile write of a memory location with the given value without reading or dropping the old value.