Closed aliostad closed 5 years ago
I answered in #19.
Also you may use Symbol
structs from here: https://github.com/Spreads/Spreads/blob/master/src/Spreads.Core/DataTypes/Symbol.cs
if you need fixed-size structs for strings.
It is all not particularly important how you get a byte pointer and its length.
Generic methods in this library are just helper utilities for blittable structs that convert them to DirectBuffer anyway. See the implementation of methods that accept generics - they just redirect to overloads with DirectBuffer and do the fast conversion from structs to DirectBuffer on the stack.
I could create an overload for string keys, but then need to decide on default encoding and add this as a parameter. This should be out of scope of this library. Example is already in #19.
On the same topic, I need to store string for keys. From my understanding, keys and values are bytes in LMDB but in this library they are meant to be
struct
.Is it not possible from your library? I understand that the
struct
makes the use ofSpan
s possible but can be limiting. Happy also to open an issue for it so the answer stays.It is certainly possible to create a struct to represent a fixed-length string with implicit conversion as below but a bit clunky.