Create `RangedIndex` interface used in C# codegen similar to Rust
Currently, the module-side generated data structures for indexes don't implement a single interface, despite all having the same interface. The generated code for these looks like
public sealed class nameIndex() : SpacetimeDB.Internal.IndexBase<global::SpacetimeDB.Modules.ModuleTestCs.TestE>("test_e_name_idx_btree") {
public IEnumerable<global::SpacetimeDB.Modules.ModuleTestCs.TestE> Filter(string name) =>
DoFilter(new SpacetimeDB.Internal.BTreeIndexBounds<string, SpacetimeDB.BSATN.String>(name));
public ulong Delete(string name) =>
DoDelete(new SpacetimeDB.Internal.BTreeIndexBounds<string, SpacetimeDB.BSATN.String>(name));
public IEnumerable<global::SpacetimeDB.Modules.ModuleTestCs.TestE> Filter(Bound<string> name) =>
DoFilter(new SpacetimeDB.Internal.BTreeIndexBounds<string, SpacetimeDB.BSATN.String>(name));
public ulong Delete(Bound<string> name) =>
DoDelete(new SpacetimeDB.Internal.BTreeIndexBounds<string, SpacetimeDB.BSATN.String>(name));
}
Either IndexBase should grow more methods, an interface should be added, or this sort of index should be converted to a single data structure. This is a wart that could be fixed backwards-compatibly since it is only visible inside modules.
Dev ex team to triage based on user requests. Core team may implement.
This may not be possible, there are comments scattered around saying C# generics can interact badly with mixed use of struct and reference types. Will need careful testing.