Subslices

Derive Macro Subslices 

Source
#[derive(Subslices)]
{
    // Attributes available to this derive:
    #[value_traits_subslices]
}
Expand description

A derive macro fully implementing subslices on top of a SliceByValue.

The macro defines a structure <YOUR TYPE>SubsliceImpl that keeps track of a reference to a slice, and of the start and end of the subslice. <YOUR TYPE>SubsliceImpl then implements SliceByValue and SliceByValueSubslice.

§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_subslices(bound = "<BOUND>")] attribute. Multiple bounds can be specified with multiple attributes.