The fundamental building block of warp is the Filter, they can be combined and composed to express rich requirements on requests. A Filter in warp is essentially a function that can operate on some input, either something from a request, or something from a previous Filter, and returns some output, which could be some app-specific type you wish to pass around, or can be some reply to send back as an HTTP response. That might sound simple, but the exciting part is the combinators that exist on the Filter trait. These allow composing smaller Filters into larger ones, allowing you to modularize, and reuse any part of your web server. As awesome as the Filter system is, if warp didn’t provide common web server features, it’d still be annoying to work with. Thus, warp provides a bunch of built-in Filters, allowing you to compose the functionality you need to describe each route or resource or sub-whatever.
Features
- Path routing and parameter extraction
- Header requirements and extraction
- Query string deserialization
- JSON and Form bodies
- Multipart form data
- Static Files and Directories