Struct constmuck::IsCopy [−][src]
pub struct IsCopy<T> { /* fields omitted */ }
Expand description
Encodes that a T
is trivially copyable.
Related: the copying
module
Bound
This currently requires Pod
because the approach constmuck has for copying uses
an intermediate MaybeUninit<[u8; N]>
,
which isn’t settled as being sound to use with pointer types,
but is guaranteed sound for Pod
types.
If there’s a more permissive bound that allows more non-pointer-containing
Copy
types, IsCopy
will be changed to use that.
Implementations
Constructs an IsCopy<T>
without checking that T
implements Copy
+ Pod
.
Safety
You must ensure that T
is safe to memcpy
without forgetting the
copied-from value, and doesn’t contain pointers of any kind.
The “no pointers” requirement is due to how constmuck::copying
copies values, and might be lifted in the future.