Commit graph

25 commits

Author SHA1 Message Date
David Pedersen
8a82fd00aa
Add bb8 connection pool example (#19)
I figure this will be quite common.
2021-06-15 22:25:41 +02:00
David Pedersen
b6e67eefd7
Add support for extracting typed headers (#18)
Uses the `headers` crate.
2021-06-15 21:27:21 +02:00
David Pedersen
2f6699aeae
Add HTML template example (#17) 2021-06-13 13:58:12 +02:00
David Pedersen
1002685a20
Rename to awebframework (#13) 2021-06-13 11:22:02 +02:00
David Pedersen
04d62798b6
Reduce body boxing (#9)
Previously, when routing between one or two requests the two body types
would be merged by boxing them. This isn't ideal since it introduces a
layer indirection for each route.

We can't require the services to be routed between as not all services
use the same body type.

This changes that so it instead uses an `Either` enum that implements
`http_body::Body` if each variant does. Will reduce the overall
allocations and hopefully the compiler can optimize things if both
variants are the same.
2021-06-12 23:59:18 +02:00
David Pedersen
b3bc4e024c
Add RoutingDsl::{serve, into_make_service} (#8) 2021-06-12 21:44:40 +02:00
David Pedersen
c9c507aece
Add support for websockets (#3)
Basically a copy/paste of whats in warp.

Example usage:

```rust
use tower_web::{prelude::*, ws::{ws, WebSocket}};

let app = route("/ws", ws(handle_socket));

async fn handle_socket(mut socket: WebSocket) {
    while let Some(msg) = socket.recv().await {
        let msg = msg.unwrap();
        socket.send(msg).await.unwrap();
    }
}
```
2021-06-12 20:50:30 +02:00
David Pedersen
002e3f92b3
Misc repo setup (#7) 2021-06-12 20:18:21 +02:00
David Pedersen
099e886575 Notes on backpressure 2021-06-08 23:55:25 +02:00
David Pedersen
21872c9f7a Remove some unnecessary dependencies 2021-06-08 22:27:38 +02:00
David Pedersen
1f8b39f05d More docs and expand key_value_store example 2021-06-08 12:43:16 +02:00
David Pedersen
a005427d40 Write some docs 2021-06-06 15:19:54 +02:00
David Pedersen
c3977d0b71 Change routing DSL 2021-06-04 01:00:48 +02:00
David Pedersen
00737c4e0a checkpoint 2021-06-02 22:07:37 +02:00
David Pedersen
ea582ab8d9 Quality of life improvements 2021-06-01 14:52:18 +02:00
David Pedersen
f690e74275 Support nesting services with error handling 2021-06-01 11:23:56 +02:00
David Pedersen
f6b1a6f435 More work 2021-05-31 16:28:26 +02:00
David Pedersen
593c901aab Start writing more tests 2021-05-31 12:22:16 +02:00
David Pedersen
7328127a3d Add example 2021-05-30 14:33:36 +02:00
David Pedersen
2e16842431 Add extension extractor 2021-05-30 11:07:56 +02:00
David Pedersen
b763eaa037 Fix layer support 2021-05-30 04:28:24 +02:00
David Pedersen
f983b37fea Support routing to tower services 2021-05-30 03:12:47 +02:00
David Pedersen
a04c98dd42 Support any type of response body 2021-05-30 01:57:01 +02:00
David Pedersen
0513b56faf better readiness handling and less boxing 2021-05-30 01:11:18 +02:00
David Pedersen
07294378b3 Initial pile of hacks 2021-05-29 21:13:06 +02:00