uniform-array-derive
Derive array-like behavior for your structs of uniform types.
This will derive AsRef<[T]>
, AsMut<[T]>,
Deref<Target = [T]>,
DerefMut,
Index<Target = T>and
IndexMutfor your homogeneous structs field type
T. Since the generated code is
unsafe, it is feature gated behind a
#[cfg(feature = "unsafe")]` by default.
;
If you need to rename the feature gate, you can do that as well:
/// Use a custom feature gate instead of "unsafe".
If you only need to ensure that all your fields have the same type, consider the ensure-uniform-type crate instead.