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

You can also use the IsCopy macro to construct IsCopy arguments.

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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Constructs this type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.