You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was pondering khonsulabs/bonsaidb#184 and how it was a shame that floats weren't orderable at the bit level so that they could be used in keys. It occurred to me that we might be able to convert the current usage of [u8] as the key type into something like what BonsaiDb has in its Key trait -- perhaps the Key trait moves to Nebari.
Instead of requiring Key to be binary-sortable, now it just needs to be any type that is Ord and can convert to bytes. Taking it a step further this could mean that the Key trait could be replaced as a combination of transmog::BorrowedDeserializer and Ord.
I'm not sure if all of this is actually feasible, but it could open up the possibility of any Ord type being able to be used as a Key in Nebari and BonsaiDb.
(And yes, I'm aware that floats are only PartialOrd, but that can be worked around by a simple wrapper like ordered_float)
The text was updated successfully, but these errors were encountered:
I was pondering khonsulabs/bonsaidb#184 and how it was a shame that floats weren't orderable at the bit level so that they could be used in keys. It occurred to me that we might be able to convert the current usage of
[u8]
as the key type into something like what BonsaiDb has in its Key trait -- perhaps the Key trait moves to Nebari.Instead of requiring Key to be binary-sortable, now it just needs to be any type that is Ord and can convert to bytes. Taking it a step further this could mean that the Key trait could be replaced as a combination of
transmog::BorrowedDeserializer
andOrd
.I'm not sure if all of this is actually feasible, but it could open up the possibility of any Ord type being able to be used as a Key in Nebari and BonsaiDb.
(And yes, I'm aware that floats are only PartialOrd, but that can be worked around by a simple wrapper like ordered_float)
The text was updated successfully, but these errors were encountered: