Warp speed is an example of a phrase that entered the public consciousness through science fiction and eventually gained enough popularity to end up in the dictionary. The expression was popularized on the science-fiction show Star Trek in the 1960s. On the show, warp speed.
Today, after a longer than expected wait, we're opening WARP and WARP+ (plus) to the general public. If you haven’t heard about it yet, WARP is a mobile app designed for everyone which uses our global network to secure all of your phone’s Internet traffic. What does warp mean? To warp is to distort something. (verb) An example of warp is when wood is exposed to humidity and becomes cupped and be. Warp Earth Catalog.
warp is a super-easy, composable, web server framework for warp speeds.
Thanks to its Filter
system, warp provides these out of the box:
- Path routing and parameter extraction
- Header requirements and extraction
- Query string deserialization
- JSON and Form bodies
- Multipart form data
- Static Files and Directories
- Websockets
- Access logging
- Etc
Since it builds on top of hyper, you automatically get:
- HTTP/1
- HTTP/2
- Asynchronous
- One of the fastest HTTP implementations
- Tested and correct
Filters
Warp Speed
The main concept in warp is the Filter
, which allows compositionto describe various endpoints in your web service. Besides this powerfultrait, warp comes with several built in filters, whichcan be combined for your specific needs.
As a small example, consider an endpoint that has path and header requirements:
This example composes several Filter
s together using and
:
- A path prefix of “hello”
- A path parameter of a
String
- The
user-agent
header parsed as aString
These specific filters will reject
requests that don’t matchtheir requirements.
This ends up matching requests like:
And it returns a response similar to this:
Take a look at the full list of filters
to see whatyou can build.
Testing
Testing your web services easily is extremely important, and warp providesa test
module to help send mocked requests through your service.
Modules
filters | Built-in Filters |
redirect | Redirect requests to a new location. |
reject | Rejections |
reply | Reply to requests. |
test | Test utilities to test your filters. |
Macros
path | Convenient way to chain multiple path filters together. |
Structs
Error | Errors that can happen inside warp. |
Server | A Warp Server ready to filter requests. |
TlsServer | A Warp Server ready to filter requests over TLS. |
Traits
Filter | Composable request filters. |
Functions
serve | Create a |
service | Convert a |
wrap_fn | Function that receives a filter to be combined with pre and after filters |
warp is a super-easy, composable, web server framework for warp speeds.
Thanks to its Filter
system, warp provides these out of the box:
- Path routing and parameter extraction
- Header requirements and extraction
- Query string deserialization
- JSON and Form bodies
- Multipart form data
- Static Files and Directories
- Websockets
- Access logging
- Etc
Since it builds on top of hyper, you automatically get:
- HTTP/1
- HTTP/2
- Asynchronous
- One of the fastest HTTP implementations
- Tested and correct
Filters
The main concept in warp is the Filter
, which allows compositionto describe various endpoints in your web service. Besides this powerfultrait, warp comes with several built in filters, whichcan be combined for your specific needs.
As a small example, consider an endpoint that has path and header requirements:
This example composes several Filter
s together using and
:
- A path prefix of “hello”
- A path parameter of a
String
- The
user-agent
header parsed as aString
These specific filters will reject
requests that don’t matchtheir requirements.
This ends up matching requests like:
And it returns a response similar to this:
Take a look at the full list of filters
to see whatyou can build.
Testing
Testing your web services easily is extremely important, and warp providesa test
module to help send mocked requests through your service.
Modules
filters | Built-in Filters |
redirect | Redirect requests to a new location. |
reject | Rejections |
reply | Reply to requests. |
test | Test utilities to test your filters. |
Macros
Warps Jpop
path | Convenient way to chain multiple path filters together. |
Structs
Error | Errors that can happen inside warp. |
Server | A Warp Server ready to filter requests. |
TlsServer | A Warp Server ready to filter requests over TLS. |
Traits
Filter | Composable request filters. |
Functions
serve | Create a |
service | Convert a |
wrap_fn | Function that receives a filter to be combined with pre and after filters |