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

Composable QueryDispatcher #218

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Neo-Zhixing
Copy link
Contributor

Resolves #8

Implements @Ralith 's suggestion regarding composable QueryDispatcher.

End-user ergonomics could be preserved by relegating the root_dispatcher argument to a trait for use only by shape implementers, and turning QueryDispatcher into a blanket-implemented trait that encapsulates the self.query(self, ...) dance, and provides a chain helper for composition.

I prefer this solution over the one suggested by @sebcrozet because @Ralith 's solution allows external crates to composably define shapes that need to dispatch recursively.

@Ralith
Copy link
Contributor

Ralith commented Jul 3, 2024

Thanks for building this out! This does look like what I had in mind. I didn't pursue it because I didn't have a pressing need, but I do think something like this is the right long term solution.

@Vrixyz Vrixyz added the enhancement New feature or request label Jul 9, 2024
@Neo-Zhixing
Copy link
Contributor Author

@sebcrozet Can you give this a review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dispatch traits aren't composable
3 participants