Copies an object and casts the result to another type.
unsafe fn copy_as<T, U>(src: &T) -> U
| Name | Description |
|---|---|
| src | |
T and U can have different sizes but if the size of U is larger than T and reading from the trailing bytes causes invalid memory access, the behavior is undefined.