Function std::ptr::writeStable [-]  [+] [src]

pub unsafe fn write<T>(dst: *mut T, src: T)

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

Safety

Beyond accepting a raw pointer, this operation is unsafe because it does not drop the contents of dst. This could leak allocations or resources, so care must be taken not to overwrite an object that should be dropped.

This is appropriate for initializing uninitialized memory, or overwritting memory that has previously been read from.