Function core::ptr::read
[−]
[src]
pub unsafe fn read<T>(src: *const T) -> T
Reads the value from src
`srcwithout moving it. This leaves the memory in
src` unchanged.
Safety
Beyond accepting a raw pointer, this is unsafe because it semantically
moves the value out of src
`srcwithout preventing further usage of
src. If
`.
If T
`Tis not
` is not Copy
`Copy, then care must be taken to ensure that the value at
srcis not used before the data is overwritten again (e.g. with
write,
`,
zero_memory
, or copy_memory
). Note that *src = foo
counts as a use
because it will attempt to drop the value previously at *src
`*src`.