Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supplant the Borrow bound on keys with a new AsKey trait #14

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tapeinosyne
Copy link
Contributor

@tapeinosyne tapeinosyne commented Oct 4, 2017

An implementation of the AsKey trait, as proposed in #13. The primary goal of this PR is to improve the ergonomics of string keys, but it might be worth considering it as a venue to explore other key types as well.

A few things should be worth considering for review. Notably:

  • How future-proof are AsKey and Break as implemented? Should we already seek an approach that works with keys that diverge from Borrow, such as integers and slices thereof, tuples, and so on?

Before merging, there's some housekeeping to take care of:

  • update docs and readme
  • code style, formatting

tapeinosyne and others added 2 commits October 16, 2020 23:44
QP-trie keys are now bound by a new public trait, `AsKey`, rather than
`Borrow<[u8]>`. `AsKey` types must be borrowable both as a key slice,
much like in `Borrow`, and as `&[u8]`, which is used internally for
nybble operations.

The trait is implemented for common `std` types, roughly matching prior
coverage, and is amenable to further expansion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant