Comments (6)
Seems ok to me, but I think we'll learn a lot from experience as tokio-io pushes this change throughout the community. I suspect we've still got tweaks and such to do here.
My main worry is that this would be quite a prominent dependency and would also need to be "1.0 quality", but we've committed to doing that with the Tokio stack so it will happen in time anyway.
from http.
That being said I think we should avoid this wherever possible. In the sense that if we can think of an ergonomic way to avoid exposing buffers that'd be great (just more flexible in general). If we must expose buffers then this seems like a good choice.
from http.
@alexcrichton So, the issue refers more to using bytes for storing internal data and not so much for the public API. I would agree that the public API should avoid exposing types from bytes
as much as possible and limit when only necessary to avoid copies in some specialty fns.
from http.
Oh ok, if this is a private dependency I don't have much of an opinion here.
from http.
Here are the options:
- Don't use
bytes
and use generics for all types that require byte storage, this will make the API painful - Don't use
bytes
and useVec
for internal byte storage, this will require significant allocations / copies and will have a large perf hit. - Use
bytes
and try to encapsulate it as much as possible.
from http.
I'll punt to #10 as it has a dependency on bytes.
from http.
Related Issues (20)
- `InvalidUri` errors could probably include the invalid bytes HOT 8
- Define policy for which header name constants to include HOT 9
- Make it easier to mutate query parameters in `Uri` HOT 1
- Why need to wrap with Option before downcast? HOT 3
- [Breaking Change] Headers' IntoIterator should return a tuple (HeaderName, T) rather than T
- A `method!` macro to define methods at build time HOT 8
- Add `from_string` for `HeaderName/HeaderValue` ? HOT 1
- Implement common trait(s) to expose common traits of HTTP message (header) types HOT 3
- Cannot change path of Uri with less than two failure branches
- feat: A `username` method for `Authority` HOT 5
- `const` assignment of `HeaderName::from_static` HOT 3
- How can I insert a Key_value into `HeaderMap` from user input or database, and the input Header is'nt `Standrad header` HOT 2
- Constants for `x-forwarded-*` headers
- Why is there a `uri_mut` on `Request` if there's no `&mut self` methods on `Uri`? HOT 1
- Undocumented capacity limit for HeaderMap HOT 3
- HeaderMap::from_iter panics when size is known
- Conversions between Bytes and HeaderValue HOT 2
- Clippy considers HeaderName to be "interior mutable" HOT 3
- The request header does not support uppercase letters HOT 1
- Add Option<&'static [u8]> method for header names
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 http.