Comments (1)
As alluded to in the code comments, I'd love to come up with a solution that tracks this statically. Such that once headers have been written, the status code and headers are no longer mutable, and the compiler will error if tried to mutate.
I've considering something like:
struct Request {
pub headers: Headers,
pub status: StatusCode,
}
struct InFlightRequest {
headers: HeadersView, // can look at headers, but no set/remove methods.
// something similar with `status`. or maybe it just becomes a getter function
}
// ..
fn handle(req: Request, res: Response) {
req.headers.set(Foo);
let body = req.start();
body.headers.set(Bar); // No method `set`
}
from hyper.
Related Issues (20)
- proto/h1: spurious copy-allocation in request parsing hotpath HOT 4
- graceful shutdown does not shutdown when i use Google Chrome。 HOT 4
- hyper-util: add test for graceful shutdown
- The performance problem of hyper v1 gateway of http1 with the log4rs HOT 5
- hyper-util auto version detection breaks the ability to use `Upgraded::downcast` HOT 2
- http1.1 protocol downgrade
- Expose Service and HttpService without features HOT 2
- [0.14.x] Expose `hyper::client::connect::http::ConnectError` HOT 2
- `Uri` shouldn't accept curly braces (`{`, `}`) in path parts HOT 9
- Futures-util dev dependency should require alloc feature HOT 3
- Problems building hyper on linux for curl CI HOT 2
- Need an examples of http2 client for hyper
- Expose a function to check if a `hyper::Error` is due to a `BodyWrite` HOT 2
- Memory Leak in case of "IncompleteMessage: connection closed before message completed" HOT 3
- Hyper server hangs when handling a request from a client on the same host (not necessarily the same process) HOT 2
- Panic on graceful shutdown for http/1
- HTTP2 Max Streams aware client pooling HOT 5
- Support HTTP2 upgrades with !Send executors HOT 2
- Panic in `UpgradeableConnection` due to `unwrap`
- hyper-util: client connection pool idle timeout does not work as expected HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyper.