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

Let tries carry a payload #22

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

dennis-tra
Copy link

@dennis-tra dennis-tra commented Jul 5, 2023

When implementing the trie routing table in go-kademlia we found it would be useful if the trie data structure carried some data in each of its leaves.

This PR adds a generic Data property to the trie.

Caveats

  • This breaks the public API
  • We could keep the New method without type parameters that calls another NewWithData[T any] constructor, which sets the data type to any. This way downstream projects that use the New probably won't notice
  • The behavior of unions and intersections would need to be defined and documented in a code comment.

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