Better public API for user variables, avoid allocations in Context. #38

Merged
projectmoon merged 1 commits from many-trees into master 2020-11-03 20:31:30 +00:00
Owner

The database API for user variables has changed somewhat again, this
time closer to the proper vision. There are now two separate sled
Trees in the Variables struct, one for user-defined variables, and one
for counts. Keys have been changed to be username-first, then room ID.
The signatures of the functions now also use a strongly-typed struct,
UserAndRoom.

As part of this, the Context object now once again avoids allocating
new strings.

Other random changes included here:

  • Remove tempfile crate in favor of sled temporary db config.
  • Add bincode crate in anticipation of future (de)serializing.
The database API for user variables has changed somewhat again, this time closer to the proper vision. There are now two separate sled Trees in the Variables struct, one for user-defined variables, and one for counts. Keys have been changed to be username-first, then room ID. The signatures of the functions now also use a strongly-typed struct, UserAndRoom. As part of this, the Context object now once again avoids allocating new strings. Other random changes included here: - Remove tempfile crate in favor of sled temporary db config. - Add bincode crate in anticipation of future (de)serializing.
Sign in to join this conversation.
No description provided.