Function lrs::mem::copy_as

Copies an object and casts the result to another type.

Syntax

unsafe fn copy_as<T, U>(src: &T) -> U

Arguments

NameDescription
src

Remarks

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.