Skip to content

Deconstruct State for handler functions #494

@msrd0

Description

@msrd0

Currently, all handler functions take either State or &State as their only parameter, and need to retrieve all information they need in user code. It would be more convenient if we allowed for syntax like this:

route.get("/").to(|(headers, body): (HeaderMap, Body)| { /* create response */ })

This was first suggested by @tanriol in the Gitter chat.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions