Skip to content

Consider adding TryFrom<&Uri> for Query #2048

@CosmicHorrorDev

Description

@CosmicHorrorDev
  • I have looked for existing issues (including closed) about this

Feature Request

Consider adding impl TryFrom<&Uri> for axum::extract::Query

Motivation

I was porting a project from rocket and axum and accidentally regressed some endpoints from differences in query parsing. It would have been nice to have a simple way to test the query parsing in isolation, but the simplest solution I could come up with was to just copy the internals of Query's FromRequestParts

Proposal

Move the logic from Query's FromRequestParts implementation into TryFrom<&Uri> for Query and call Query::try_from(&parts.uri) in from_request_parts()

Only drawback I can think of is that this adds some slight noise to the API

Alternatives

None that seem compelling

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-axumC-feature-requestCategory: A feature request, i.e: not implemented / a PR.E-easyCall for participation: Experience needed to fix: Easy / not muchE-help-wantedCall for participation: Help is requested to fix this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions