File tree Expand file tree Collapse file tree 5 files changed +60
-1
lines changed Expand file tree Collapse file tree 5 files changed +60
-1
lines changed Original file line number Diff line number Diff line change 11
11
readme = " README.md"
12
12
edition = " 2018"
13
13
14
+ [package .metadata .docs .rs ]
15
+ features = [" docs" ]
16
+ rustdoc-args = [" --cfg" , " feature=\" docs\" " ]
17
+
14
18
[features ]
15
19
default = []
20
+ docs = [" unstable" ]
21
+ unstable = []
16
22
hyperium_http = [" http" ]
17
23
18
24
[dependencies ]
Original file line number Diff line number Diff line change
1
+ use std:: fmt:: Debug ;
2
+ use std:: future:: Future ;
3
+ use std:: pin:: Pin ;
4
+
5
+ use crate :: { Request , Response , Result } ;
6
+
7
+ type BoxFuture < ' a , T > = Pin < Box < dyn Future < Output = T > + ' a + Send > > ;
8
+
9
+ /// An HTTP client.
10
+ #[ cfg( feature = "unstable" ) ]
11
+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
12
+ pub trait Client : Debug + Unpin + Send + Sync + Clone + ' static {
13
+ /// Send an HTTP request from the client.
14
+ fn send_req ( & self , req : Request ) -> BoxFuture < ' static , Result < Response > > ;
15
+ }
Original file line number Diff line number Diff line change 95
95
96
96
#![ forbid( rust_2018_idioms) ]
97
97
#![ deny( missing_debug_implementations, nonstandard_style) ]
98
- #![ warn( missing_docs, missing_doc_code_examples , unreachable_pub) ]
98
+ #![ warn( missing_docs, unreachable_pub) ]
99
99
#![ cfg_attr( test, deny( warnings) ) ]
100
+ #![ cfg_attr( feature = "docs" , feature( doc_cfg) ) ]
100
101
101
102
/// HTTP cookies.
102
103
pub mod cookies {
@@ -111,6 +112,9 @@ pub mod url {
111
112
} ;
112
113
}
113
114
115
+ #[ macro_use]
116
+ mod utils;
117
+
114
118
pub mod headers;
115
119
pub mod mime;
116
120
@@ -125,6 +129,14 @@ mod status_code;
125
129
mod type_map;
126
130
mod version;
127
131
132
+ cfg_unstable ! {
133
+ mod client;
134
+ mod server;
135
+
136
+ pub use client:: Client ;
137
+ pub use server:: Server ;
138
+ }
139
+
128
140
pub use body:: Body ;
129
141
pub use error:: { Error , Result } ;
130
142
pub use method:: Method ;
Original file line number Diff line number Diff line change
1
+ use std:: fmt:: Debug ;
2
+ use std:: future:: Future ;
3
+ use std:: pin:: Pin ;
4
+
5
+ use crate :: { Request , Response , Result } ;
6
+
7
+ type BoxFuture < ' a , T > = Pin < Box < dyn Future < Output = T > + ' a + Send > > ;
8
+
9
+ /// An HTTP server.
10
+ #[ cfg( feature = "unstable" ) ]
11
+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
12
+ pub trait Server : Debug + Unpin + Send + Sync + Clone + ' static {
13
+ /// Receive an HTTP request on the server.
14
+ fn recv_req ( & self , req : Request ) -> BoxFuture < ' static , Result < Response > > ;
15
+ }
Original file line number Diff line number Diff line change
1
+ /// Declares unstable items.
2
+ #[ doc( hidden) ]
3
+ macro_rules! cfg_unstable {
4
+ ( $( $item: item) * ) => {
5
+ $(
6
+ #[ cfg( feature = "unstable" ) ]
7
+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
8
+ $item
9
+ ) *
10
+ }
11
+ }
You can’t perform that action at this time.
0 commit comments