pub trait CopyAs<T> {
// Required method
fn copy_as(self) -> T;
}
Expand description
Types that can be converted into another type by copying.
We use this trait to unify the ability of T
and &T
to be converted into T
.
This is handy for copy types that we’d like to use, like u8
, u64
and usize
.