curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/tokio-rs/axum.git
cd axum/
cargo build --features ws --example websocket
Updating crates.io index
Compiling autocfg v1.0.1
Compiling cfg-if v1.0.0
Compiling proc-macro2 v1.0.28
Compiling unicode-xid v0.2.2
Compiling syn v1.0.74
Compiling libc v0.2.98
Compiling version_check v0.9.3
Compiling memchr v2.4.0
Compiling log v0.4.14
Compiling pin-project-lite v0.2.7
Compiling bytes v1.0.1
Compiling futures-core v0.3.16
Compiling smallvec v1.6.1
Compiling typenum v1.13.0
Compiling proc-macro-hack v0.5.19
Compiling scopeguard v1.1.0
Compiling proc-macro-nested v0.1.7
Compiling futures-channel v0.3.16
Compiling futures-sink v0.3.16
Compiling futures-task v0.3.16
Compiling bitflags v1.2.1
Compiling ryu v1.0.5
Compiling futures-io v0.3.16
Compiling pin-utils v0.1.0
Compiling matches v0.1.8
Compiling serde_derive v1.0.126
Compiling slab v0.4.3
Compiling tinyvec_macros v0.1.0
Compiling lazy_static v1.4.0
Compiling itoa v0.4.7
Compiling serde v1.0.126
Compiling percent-encoding v2.1.0
Compiling radium v0.5.3
Compiling opaque-debug v0.3.0
Compiling cc v1.0.69
Compiling fnv v1.0.7
Compiling pkg-config v0.3.19
Compiling ppv-lite86 v0.2.10
Compiling base64 v0.13.0
Compiling cpufeatures v0.1.5
Compiling lexical-core v0.7.6
Compiling wyz v0.2.0
Compiling tap v1.0.1
Compiling httparse v1.4.1
Compiling arrayvec v0.5.2
Compiling static_assertions v1.1.0
Compiling funty v1.1.0
Compiling byteorder v1.4.3
Compiling once_cell v1.8.0
Compiling openssl v0.10.35
Compiling alloc-no-stdlib v2.0.1
Compiling subtle v2.4.1
Compiling tower-service v0.3.1
Compiling async-trait v0.1.51
Compiling foreign-types-shared v0.1.1
Compiling hashbrown v0.11.2
Compiling crc32fast v1.2.1
Compiling regex-syntax v0.6.25
Compiling serde_json v1.0.66
Compiling try-lock v0.2.3
Compiling adler v1.0.2
Compiling native-tls v0.2.7
Compiling fallible-iterator v0.2.0
Compiling siphasher v0.3.6
Compiling httpdate v1.0.1
Compiling openssl-probe v0.1.4
Compiling mime v0.3.16
Compiling tower-layer v0.3.1
Compiling askama_escape v0.10.1
Compiling utf-8 v0.7.6
Compiling humansize v1.1.1
Compiling encoding_rs v0.8.28
Compiling ipnet v2.3.1
Compiling ansi_term v0.12.1
Compiling instant v0.1.10
Compiling lock_api v0.4.4
Compiling input_buffer v0.4.0
Compiling generic-array v0.14.4
Compiling nom v6.1.2
Compiling unicase v2.6.0
Compiling tokio v1.9.0
Compiling futures-macro v0.3.16
Compiling futures-util v0.3.16
Compiling num-traits v0.2.14
Compiling indexmap v1.7.0
Compiling miniz_oxide v0.4.4
Compiling num-integer v0.1.44
Compiling unicode-bidi v0.3.5
Compiling tinyvec v1.3.1
Compiling tracing-core v0.1.18
Compiling sharded-slab v0.1.1
Compiling http v0.2.4
Compiling form_urlencoded v1.0.1
Compiling alloc-stdlib v0.2.1
Compiling thread_local v1.1.3
Compiling foreign-types v0.3.2
Compiling phf_shared v0.8.0
Compiling openssl-sys v0.9.65
Compiling brotli-decompressor v2.3.1
Compiling phf v0.8.0
Compiling want v0.3.0
Compiling tracing-log v0.1.2
Compiling quote v1.0.9
Compiling aho-corasick v0.7.18
Compiling unicode-normalization v0.1.19
Compiling regex-automata v0.1.10
Compiling parking_lot_core v0.8.3
Compiling mio v0.7.13
Compiling num_cpus v1.13.0
Compiling getrandom v0.2.3
Compiling socket2 v0.4.1
Compiling bitvec v0.19.5
Compiling http-body v0.4.2
Compiling mime_guess v2.0.3
Compiling parking_lot v0.11.1
Compiling rand_core v0.6.3
Compiling regex v1.5.4
Compiling flate2 v1.0.20
Compiling brotli v3.3.0
Compiling idna v0.2.3
Compiling stringprep v0.1.2
Compiling matchers v0.0.1
Compiling digest v0.9.0
Compiling block-buffer v0.9.0
Compiling crypto-mac v0.10.1
Compiling rand_chacha v0.3.1
Compiling url v2.2.2
Compiling chrono v0.4.19
Compiling hmac v0.10.1
Compiling sha2 v0.9.5
Compiling md-5 v0.9.1
Compiling sha-1 v0.9.7
Compiling rand v0.8.4
Compiling postgres-protocol v0.6.1
Compiling postgres-types v0.2.1
Compiling iri-string v0.4.0
Compiling tokio-macros v1.3.0
Compiling tracing-attributes v0.1.15
Compiling pin-project-internal v1.0.8
Compiling thiserror-impl v1.0.26
Compiling thiserror v1.0.26
Compiling tungstenite v0.13.0
Compiling pin-project v1.0.8
Compiling tracing v0.1.26
Compiling futures-executor v0.3.16
Compiling futures v0.3.16
Compiling tokio-util v0.6.7
Compiling async-compression v0.3.8
Compiling tokio-native-tls v0.3.0
Compiling bb8 v0.7.0
Compiling tokio-tungstenite v0.14.0
Compiling h2 v0.3.3
Compiling tower v0.4.8
Compiling tokio-postgres v0.7.2
Compiling tower-http v0.1.1
Compiling bb8-postgres v0.7.0
Compiling toml v0.5.8
Compiling serde_urlencoded v0.7.0
Compiling tracing-serde v0.1.2
Compiling uuid v0.8.2
Compiling tracing-subscriber v0.2.19
Compiling askama_shared v0.11.1
Compiling hyper v0.14.11
Compiling askama_derive v0.10.5
Compiling askama v0.10.5
Compiling hyper-tls v0.5.0
Compiling axum v0.1.1 (~/axum)
Compiling reqwest v0.11.4
error[E0432]: unresolved import `axum::extract::TypedHeader`
--> examples/websocket.rs:13:5
|
13 | extract::TypedHeader,
| ^^^^^^^^^^^^^^^^^^^^ no `TypedHeader` in `extract`
error[E0433]: failed to resolve: use of undeclared crate or module `headers`
--> examples/websocket.rs:64:42
|
64 | TypedHeader(user_agent): TypedHeader<headers::UserAgent>,
| ^^^^^^^ use of undeclared crate or module `headers`
error[E0277]: the trait bound `fn(WebSocket, [type error]) -> impl Future {handle_socket}: WebSocketHandler<_, _>` is not satisfied
--> examples/websocket.rs:46:22
|
46 | .route("/ws", ws(handle_socket))
| ^^^^^^^^^^^^^ the trait `WebSocketHandler<_, _>` is not implemented for `fn(WebSocket, [type error]) -> impl Future {handle_socket}`
|
::: ~/axum/src/ws/mod.rs:90:8
|
90 | F: WebSocketHandler<B, T>,
| ---------------------- required by this bound in `ws`
error[E0277]: the trait bound `fn(WebSocket, [type error]) -> impl Future {handle_socket}: WebSocketHandler<_, _>` is not satisfied
--> examples/websocket.rs:46:19
|
46 | .route("/ws", ws(handle_socket))
| ^^^^^^^^^^^^^^^^^ the trait `WebSocketHandler<_, _>` is not implemented for `fn(WebSocket, [type error]) -> impl Future {handle_socket}`
|
= note: required because of the requirements on the impl of `Service<Request<_>>` for `WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, _, _>`
error[E0277]: the trait bound `fn(WebSocket, [type error]) -> impl Future {handle_socket}: WebSocketHandler<hyper::Body, _>` is not satisfied
--> examples/websocket.rs:56:16
|
56 | .serve(app.into_make_service())
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `WebSocketHandler<hyper::Body, _>` is not implemented for `fn(WebSocket, [type error]) -> impl Future {handle_socket}`
|
= note: required because of the requirements on the impl of `Service<Request<hyper::Body>>` for `WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>`
= note: 2 redundant requirements hidden
= note: required because of the requirements on the impl of `Service<Request<hyper::Body>>` for `tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>`
= note: required because of the requirements on the impl of `hyper::service::http::HttpService<hyper::Body>` for `axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>`
= note: required because of the requirements on the impl of `hyper::service::make::MakeServiceRef<AddrStream, hyper::Body>` for `tower::make::make_service::shared::Shared<axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>>`
error[E0277]: the trait bound `hyper::common::exec::Exec: hyper::common::exec::ConnStreamExec<tower_http::trace::ResponseFuture<RouteFuture<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>, hyper::Body>, ServerErrorsAsFailures, DefaultOnResponse, DefaultOnBodyChunk, DefaultOnEos, DefaultOnFailure>, tower_http::trace::ResponseBody<http_body::combinators::box_body::BoxBody<hyper::body::Bytes, BoxStdError>, NeverClassifyEos<ServerErrorsFailureClass>, DefaultOnBodyChunk, DefaultOnEos, DefaultOnFailure>>` is not satisfied
--> examples/websocket.rs:55:5
|
55 | / hyper::Server::bind(&addr)
56 | | .serve(app.into_make_service())
57 | | .await
| |______________^ the trait `hyper::common::exec::ConnStreamExec<tower_http::trace::ResponseFuture<RouteFuture<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>, hyper::Body>, ServerErrorsAsFailures, DefaultOnResponse, DefaultOnBodyChunk, DefaultOnEos, DefaultOnFailure>, tower_http::trace::ResponseBody<http_body::combinators::box_body::BoxBody<hyper::body::Bytes, BoxStdError>, NeverClassifyEos<ServerErrorsFailureClass>, DefaultOnBodyChunk, DefaultOnEos, DefaultOnFailure>>` is not implemented for `hyper::common::exec::Exec`
|
= help: the following implementations were found:
<hyper::common::exec::Exec as hyper::common::exec::ConnStreamExec<F, B>>
= note: required because of the requirements on the impl of `Future` for `Server<AddrIncoming, tower::make::make_service::shared::Shared<axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>>>`
= note: required by `poll`
error[E0277]: the trait bound `hyper::common::exec::Exec: hyper::common::exec::NewSvcExec<AddrStream, tower::make::make_service::shared::SharedFuture<axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>>, axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>, hyper::common::exec::Exec, hyper::server::conn::spawn_all::NoopWatcher>` is not satisfied
--> examples/websocket.rs:55:5
|
55 | / hyper::Server::bind(&addr)
56 | | .serve(app.into_make_service())
57 | | .await
| |______________^ the trait `hyper::common::exec::NewSvcExec<AddrStream, tower::make::make_service::shared::SharedFuture<axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>>, axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>, hyper::common::exec::Exec, hyper::server::conn::spawn_all::NoopWatcher>` is not implemented for `hyper::common::exec::Exec`
|
= help: the following implementations were found:
<hyper::common::exec::Exec as hyper::common::exec::NewSvcExec<I, N, S, E, W>>
= note: required because of the requirements on the impl of `Future` for `Server<AddrIncoming, tower::make::make_service::shared::Shared<axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>>>`
= note: required by `poll`
error[E0277]: the trait bound `fn(WebSocket, [type error]) -> impl Future {handle_socket}: WebSocketHandler<hyper::Body, _>` is not satisfied
--> examples/websocket.rs:55:5
|
55 | / hyper::Server::bind(&addr)
56 | | .serve(app.into_make_service())
57 | | .await
| |______________^ the trait `WebSocketHandler<hyper::Body, _>` is not implemented for `fn(WebSocket, [type error]) -> impl Future {handle_socket}`
|
= note: required because of the requirements on the impl of `Service<Request<hyper::Body>>` for `WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>`
= note: 2 redundant requirements hidden
= note: required because of the requirements on the impl of `Service<Request<hyper::Body>>` for `tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>`
= note: required because of the requirements on the impl of `hyper::service::http::HttpService<hyper::Body>` for `axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>`
= note: required because of the requirements on the impl of `hyper::service::make::MakeServiceRef<AddrStream, hyper::Body>` for `tower::make::make_service::shared::Shared<axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>>`
= note: required because of the requirements on the impl of `Future` for `Server<AddrIncoming, tower::make::make_service::shared::Shared<axum::routing::Layered<tower_http::trace::Trace<Route<WebSocketUpgrade<fn(WebSocket, [type error]) -> impl Future {handle_socket}, hyper::Body, _>, Nested<axum::service::OnMethod<BoxResponseBody<HandleError<ServeDir, [closure@examples/websocket.rs:36:31: 41:18], hyper::Body>, hyper::Body>, EmptyRouter>, EmptyRouter>>, SharedClassifier<ServerErrorsAsFailures>>>>>`
= note: required by `poll`
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0277, E0432, E0433.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `axum`
To learn more, run the command again with --verbose.