Skip to content

Example for HyperResponse doesn't compile  #173

@lpil

Description

@lpil

Hello!

I attempted to compile the HyperResponse example (http://cyderize.github.io/rust-websocket/doc/websocket/server/upgrade/sync/struct.HyperRequest.html) with current Hyper, but it doesn't type check.

error[E0599]: no function or associated item named `http` found for type `hyper::Server<_, _>` in the
current scope
 --> src/server/mod.rs:7:5
  |
7 |     Server::http("0.0.0.0:80")
  |     ^^^^^^^^^^^^ function or associated item not found in `hyper::Server<_, _>`

error[E0308]: mismatched types
  --> src/server/mod.rs:10:32
   |
10 |             match HyperRequest(req).into_ws() {
   |                                ^^^ expected struct `hyper::server::request::Request`, found struc
t `hyper::Request`
   |
   = note: expected type `hyper::server::request::Request<'_, '_>`
              found type `hyper::Request`

error[E0599]: no method named `send` found for type `hyper::Response` in the current scope
  --> src/server/mod.rs:23:25
   |
23 |                     res.send(b"Try connecting over ws instead.").unwrap();
   |                         ^^^^

error: aborting due to 3 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions