Trait evmap::ShallowCopy
source · pub trait ShallowCopy {
unsafe fn shallow_copy(&mut self) -> Self;
}
Expand description
Types that implement this trait can be cheaply copied by (potentially) aliasing the data they contain.
Required Methods
sourceunsafe fn shallow_copy(&mut self) -> Self
unsafe fn shallow_copy(&mut self) -> Self
Perform an aliasing copy of this value.
The use of this method is only safe if the values involved are never mutated, and only
one of the copies is dropped; the remaining copies must be forgotten with mem::forget
.