Unsafe pointer utility functions
externfnpointers |
RawPtr |
array_each | Given a null-pointer-terminated **T (pointer to an array of pointers), iterate through each *T, passing to the provided callback function |
array_each_with_len | Given a **T (pointer to an array of pointers),
iterate through each *T, up to the provided |
buf_len | Return the offset of the first null pointer in |
copy_memory | Copies data from one location to another. |
copy_nonoverlapping_memory | Copies data from one location to another. |
is_not_null | Returns true if the pointer is not equal to the null pointer. |
is_null | Returns true if the pointer is equal to the null pointer. |
mut_null | Create an unsafe mutable null pointer |
mut_offset | Calculate the offset from a mut pointer. The count must be in bounds or otherwise the loads of this address are undefined. |
null | Create an unsafe null pointer |
offset | Calculate the offset from a pointer |
position | Return the first offset |
read_and_zero_ptr | Reads the value from |
read_ptr | Reads the value from |
replace_ptr | Replace the value at a mutable location with a new one, returning the old value, without deinitialising or copying either one. |
set_memory | Invokes memset on the specified pointer, setting |
swap_ptr | Swap the values at two mutable locations of the same type, without deinitialising or copying either one. |
to_mut_unsafe_ptr | Transform a mutable region pointer - &mut T - to a mutable unsafe pointer - *mut T. |
to_unsafe_ptr | Transform a region pointer - &T - to an unsafe pointer - *T. |
zero_memory | Zeroes out |
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).