Skip to content

Allow finding all matches #80

@StupendousYappi

Description

@StupendousYappi

I'm working on a web framework that closely integrates with Postgres, and one feature I'd like to offer is the ability to define preprocessors that run before the main request handler does. My request handlers currently use matchit for routing, and I'd like to let users register preprocessors using the same syntax. But whereas every request should only match one request handler, it should potentially be able to match multiple preprocessors. The current Router API won't let me retrieve all the matching paths, so to do this today, I'll need to create a separate router for every preprocessor, and call at on all of them (I'll look at the static prefix portion of each preprocessor paths to skip evaluating some of them).

Would providing a Router::all_at method that returns a Vec<Match> of all the matches for a path be a reasonable feature for this crate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions