Skip to content

Support more general use cases for the extensible visitor pattern #126

Description

@soareschen

These are the current limitations of the extensible visitor pattern, which may prevent it from being used for more general use cases:

  • The visitor dispatcher currently doesn't accept additional input arguments aside from your enum. You can workaround it by supplying it in the App context and then getting it through dependency injection.
  • The HasFields implementation for enums currently lacks a version for &mut references, and thus needs to be generalized.
  • Currently you can't return references in the result, due to limitations in the current implementation.
  • Currently you need to manually wrap and unwrap the results via traits like ComputerRef. In the future, I plan to allow these wrappers to be automatically generated through macros, and support dispatching on custom traits through that.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions