Commit Graph

19 Commits

Author SHA1 Message Date
Pyfisch
8d0e5bc302 refactor(headers): export all headers and utils directly under header
Currently headers are exported at many places. For example you can access
`Transfer-Encoding` header at `header`, `header::common` and
`header::common::transfer_encoding`. Per discussion on IRC with
@seanmonstar and @reem, all contents of headers will be exposed at `header`
directly. Parsing utilities will be exposed at `header::parsing`. Header
macros can now be used from other crates.

This breaks much code using headers. It should use everything it needs
directly from `header::`, encodings are exposed at `header::Encoding::`,
connection options are exposed at `header::ConnectionOption`.
2015-01-20 13:04:42 +01:00
Sean McArthur
aa26665367 fix(header): fix fmt_header outputs of several headers
Closes #246
2015-01-13 10:42:01 -08:00
cyderize
122e94c8a6 Update for latest rust
Tracks rust nightly.

7 tests fail -- still finding source
2015-01-10 18:37:10 +11:00
Jonathan Reem
f0fe878ec8 More Rust updates:
- Some stray deriving -> derive changes
- use::{mod} -> use::{self}
- fmt.write -> fmt.write_str

This does not catch the last case of fmt.write_str in the
Show impl of a Header Item. This will need to be changed
separately.
2015-01-05 22:50:10 +01:00
Jonathan Reem
7f3a33f903 #[deriving] -> #[derive] 2015-01-03 20:31:48 +01:00
Pyfisch
76126fc6c7 feat(headers): adds Accept
Moved utils to shared/. Added quality_value.
2015-01-03 11:06:38 -08:00
Jonathan Reem
90925f05ee (fix) Add semicolons at macro invocation sites. 2014-12-20 02:38:03 -08:00
Sean McArthur
8071cfa8bf feat(headers): header ergonomics
- Reexports all common::* as header::*
- Most headers implement Deref where it makes sense.

Closes #156
2014-11-29 13:55:50 -08:00
Sean McArthur
3cd9b10bcb feat(server): keep-alive!
Internals have been shuffled around such that Request and Reponse are
now given only a mutable reference to the stream, instead of being
allowed to consume it. This allows the server to re-use the streams if
keep-alive is true.

A task pool is used, and the number of the threads can currently be
adjusted by using the `listen_threads()` method on Server.

[breaking-change]
2014-11-20 21:40:55 -08:00
Kyle Dewey
d7e8b8b117 Now using use along with enums, as per https://github.com/rust-lang/rust/pull/18973. 2014-11-19 22:03:41 +01:00
Sean McArthur
7e55506134 move other header parse utils to util module 2014-11-19 10:08:07 -08:00
Jakob Gillich
125e1f7d63 std::from_str has been moved to std::str 2014-11-17 20:09:53 +01:00
Jonathan Reem
d4312c8fe8 Add benchmarks for all implemented headers except set-cookie. 2014-11-10 16:32:30 -08:00
Hanno Braun
ab9c4f99b8 Make Connection usable
Connection's only field was private, making it impossible to construct a
Connection.
2014-11-08 22:51:28 +01:00
Jonathan Reem
0652858dbf Update all common headers for the new Header trait split 2014-10-31 15:10:34 -07:00
Sean McArthur
0ab52c9009 add bits to deal with Upgrade requests 2014-10-27 20:36:57 -07:00
Gilman Tolle
5615ab276e Exposed the 'from_one_raw_str' function for use in defining new header structs. 2014-10-15 23:40:40 -07:00
Sean McArthur
0191bff43a property treat header names as case insensitive 2014-09-23 09:02:58 -07:00
Jonathan Reem
f2c09c5743 Split common headers into a submodule and into their own files
This is a more extensible place to put them and doesn't clutter up
header/mod.rs as much as the old scheme did.

Fixes #8
2014-09-08 16:20:50 -07:00