Crate arrayref [] [src]

This package contains just two macros, for the taking of array references to slices of anything that can be sliced.

Examples

Here is a simple example of slicing and dicing a slice into array references with these macros.

I would give a real example here, but I can't figure out how to make my doctest actually load the macros...

let mut foobar = [0; 512]; let bar = array_ref!(foobar, 0, u16, 8); // first 8 elements

Macros

array_mut_ref!

You can use array_mut_ref to generate a mutable array reference to a subset of a sliceable bit of data (which could be an array, or a slice, or a Vec).

array_ref!

You can use array_ref to generate an array reference to a subset of a sliceable bit of data (which could be an array, or a slice, or a Vec). The arguments are a bit clumsy