feat(server): Make the server code an optional feature (#2334)
				
					
				
			cc #2223 BREAKING CHANGE: The HTTP server code is now an optional feature. To enable the server, add `features = ["server"]` to the dependency in your `Cargo.toml`.
This commit is contained in:
		| @@ -18,12 +18,15 @@ mod encode; | ||||
| mod io; | ||||
| mod role; | ||||
|  | ||||
| pub(crate) type ServerTransaction = role::Server; | ||||
|  | ||||
| cfg_client! { | ||||
|     pub(crate) type ClientTransaction = role::Client; | ||||
| } | ||||
|  | ||||
| cfg_server! { | ||||
|     pub(crate) type ServerTransaction = role::Server; | ||||
| } | ||||
|  | ||||
| pub(crate) trait Http1Transaction { | ||||
|     type Incoming; | ||||
|     type Outgoing: Default; | ||||
| @@ -73,6 +76,7 @@ pub(crate) struct ParseContext<'a> { | ||||
| pub(crate) struct Encode<'a, T> { | ||||
|     head: &'a mut MessageHead<T>, | ||||
|     body: Option<BodyLength>, | ||||
|     #[cfg(feature = "server")] | ||||
|     keep_alive: bool, | ||||
|     req_method: &'a mut Option<Method>, | ||||
|     title_case_headers: bool, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user