-
Notifications
You must be signed in to change notification settings - Fork 33
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
Did get_ancestor match? #53
Comments
I might have been looking at the wrong place, it looks like trie node |
Sorry, I should have been more clear. The only node in there is |
Oh I see what you mean now. I think it would work if the As a workaround, you could implement similar logic outside the library by using |
My use case is I have http routes like
/a
/b
in the trie, and there are some dynamic routes like/z/*
where I want to find the handler for/z
and then do something with/*
.Right now you can
The lookup seems like it keeps track of how much is left of the key while traversing the trie, so if that could be returned somehow the user could at least check if the remaining key length is 0, if not recover the utf8 suffix.
If the nodes stored parent nodes one could potentially walk back up the subtrie and concatenate prefixes to get a full utf8 prefix, and use the lengths to slice the suffix.
I'm not sure what other use cases there are here, so I'm not sure how much information would need to be returned in the general case, or what the interface should look like.
Is there an alternative way to achieve my use case with the current library?
The text was updated successfully, but these errors were encountered: