Open jakoss opened 5 years ago
I also tried:
public Span<CodeSegment> MatchTrack(long trackId)
{
var keyMemory = BitConverter.GetBytes(trackId).AsMemory();
using (keyMemory.Pin())
{
var key = new DirectBuffer(keyMemory.Span);
var value = default(DirectBuffer);
using (var cursor = databaseHolder.StoreDatabase.OpenReadOnlyCursor(tx))
{
if (cursor.TryGet(ref key, ref value, CursorGetOption.GetMultiple))
{
return MemoryMarshal.Cast<byte, CodeSegment>(value.Span);
}
}
}
return null;
}
but this gives me:
Sorry, but get multiple was never explicitly covered and we had #5 not so long ago. This is a good up-for-grabs and a pull request candidate.
I'm trying to get multiple structs saved by single key. I came up with this code:
But i'm getting exception:
I'm saving those structs like this:
The struct itself is:
Am i thinking wrong? Is it even possible to read multiple values at once into a span?