feat(SessionStore)!: make record IDs generic#253
Draft
dustypomerleau wants to merge 1 commit intomaxcountryman:mainfrom
Draft
feat(SessionStore)!: make record IDs generic#253dustypomerleau wants to merge 1 commit intomaxcountryman:mainfrom
dustypomerleau wants to merge 1 commit intomaxcountryman:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for all the time you've put into
tower-sessions!I have been looking at ways to make the built-in
Recordtype more flexible, so that it could hold any suitable value, likeUuids. My goal is to allow theIdtype in theRecordto be whatever the backing DB/store is already using for IDs.To show my use case, I copied the counter example, using a newtyped v7 UUID (see examples/uuid.rs).
The current test suite passes, but I haven't yet added any tests or completed docs. I just wanted to get a sense of whether there is interest in the PR.
My approach so far:
SessionStorethat specifies the type of the IDGenIdtrait, to allowSessionStore::Idtypes to choose how they generate new valuesSession,Record, andMemoryStore, to represent the ID typeSessionStoreforMemoryStoregenericIdtoSesId, to avoid confusing it with the associated typeHappy for any feedback.