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).

array_refs!

You can use array_refs to generate a series of array references to an input array reference. The idea is if you want to break an array into a series of contiguous and non-overlapping arrays.

mut_array_refs!

You can use mut_array_refs to generate a series of mutable array references to an input mutable array reference. The idea is if you want to break an array into a series of contiguous and non-overlapping arrays.