Interface Leap::Unity::IIndexableStruct

interface Leap.Unity.IIndexableStruct<T, ThisIndexableType>

This is a definition-friendly interface that new “indexable” struct definitions can implement to make it a little easier to implement foreach and Query() operations for their struct. (You can use the IndexableStructEnumerator for this purpose, you just have to pass it type arguments that correspond to your struct type.)

Unlike IIndexable, IIndexableStruct cannot utilize extension methods to automatically give consumers of the interface access to foreach and Query operations because consumption of a struct via an interface parameter forces the struct to be boxed, which causes allocation. As such, IIndexableStruct does not directly implement IIndexable.

(This all may change in C# 8 when we get traits, but Unity is still in the C# 4 stone age.)