Skip to content

Conversation

@PixelDust22
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.

@ThierryBerger ThierryBerger added the C-Enhancement New feature or request label Jul 9, 2024
@PixelDust22 PixelDust22 force-pushed the composable-query-dispatcher branch from 796fa34 to fc99c1a Compare July 20, 2024 21:32
@PixelDust22
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

C-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