#[derive(Iterators)]
{
// Attributes available to this derive:
#[value_traits_iterators]
}
Expand description
A derive macro fully implementing IterateByValue and
IterateByValueFrom for subslices on top of the
<YOUR TYPE>SubsliceImpl structure generated by the derive macro
Subslices.
The macro defines a structure <YOUR TYPE>Iter that keeps track of a
reference to a slice and of a current iteration range; the structure is
used to implement IterateByValue and IterateByValueFrom on
<YOUR TYPE>SubsliceImpl.
Note that the traits are implemented on <YOUR TYPE>SubsliceImpl, not on
<YOUR TYPE> itself: to iterate over the whole slice, take first a full
subslice with index_subslice(..).
The generated structure has the same visibility as the type the macro is applied to.
ยงAdditional Bounds
Since this macro has no knowledge of the bounds of the generic
parameters in the implementations of SliceByValue,
additional bounds with respect to the type declaration must be specified
using the #[value_traits_iterators(bound = "<BOUND>")] attribute. Multiple bounds can
be specified with multiple attributes.