1
1
// We have a lot of c-types in here, stop warning about their names!
2
2
#![ allow( non_camel_case_types) ]
3
+ // fmt::Debug isn't helpful on FFI types
4
+ #![ allow( missing_debug_implementations) ]
3
5
// unreachable_pub warns `#[no_mangle] pub extern fn` in private mod.
4
6
#![ allow( unreachable_pub) ]
5
7
8
+ //! # hyper C API
9
+ //!
10
+ //! This part of the documentation describes the C API for hyper. That is, how
11
+ //! to *use* the hyper library in C code. This is **not** a regular Rust
12
+ //! module, and thus it is not accessible in Rust.
13
+ //!
14
+ //! ## Unstable
15
+ //!
16
+ //! The C API of hyper is currently **unstable**, which means it's not part of
17
+ //! the semver contract as the rest of the Rust API is. Because of that, it's
18
+ //! only accessible if `--cfg hyper_unstable_ffi` is passed to `rustc` when
19
+ //! compiling. The easiest way to do that is setting the `RUSTFLAGS`
20
+ //! environment variable.
21
+ //!
22
+ //! ## Building
23
+ //!
24
+ //! The C API is part of the Rust library, but isn't compiled by default. Using
25
+ //! `cargo`, it can be compiled with the following command:
26
+ //!
27
+ //! ```notrust
28
+ //! RUSTFLAGS="--cfg hyper_unstable_ffi" cargo build --features client,http1,http2,ffi
29
+ //! ```
30
+
6
31
// We may eventually allow the FFI to be enabled without `client` or `http1`,
7
32
// that is why we don't auto enable them as `ffi = ["client", "http1"]` in
8
33
// the `Cargo.toml`.
@@ -29,16 +54,29 @@ mod http_types;
29
54
mod io;
30
55
mod task;
31
56
57
+ pub use self :: body:: * ;
58
+ pub use self :: client:: * ;
59
+ pub use self :: error:: * ;
60
+ pub use self :: http_types:: * ;
61
+ pub use self :: io:: * ;
62
+ pub use self :: task:: * ;
63
+
32
64
pub ( crate ) use self :: body:: UserBody ;
33
65
pub ( crate ) use self :: http_types:: { HeaderCaseMap , ReasonPhrase } ;
34
66
67
+ /// Return in iter functions to continue iterating.
35
68
pub const HYPER_ITER_CONTINUE : libc:: c_int = 0 ;
69
+ /// Return in iter functions to stop iterating.
36
70
#[ allow( unused) ]
37
71
pub const HYPER_ITER_BREAK : libc:: c_int = 1 ;
38
72
73
+ /// An HTTP Version that is unspecified.
39
74
pub const HYPER_HTTP_VERSION_NONE : libc:: c_int = 0 ;
75
+ /// The HTTP/1.0 version.
40
76
pub const HYPER_HTTP_VERSION_1_0 : libc:: c_int = 10 ;
77
+ /// The HTTP/1.1 version.
41
78
pub const HYPER_HTTP_VERSION_1_1 : libc:: c_int = 11 ;
79
+ /// The HTTP/2 version.
42
80
pub const HYPER_HTTP_VERSION_2 : libc:: c_int = 20 ;
43
81
44
82
struct UserDataPointer ( * mut std:: ffi:: c_void ) ;
0 commit comments