Server instances

Now we can create a server instance and bind to this address:

let builder = Server::bind(&addr);

The preceding line creates a hyper::server::Server instance with a bind constructor that actually returns Builder, not a Server instance. The Server struct implements the Future trait. It has similar role to Result, but describes a value that isn't available immediately. You'll learn more about Future and other traits of the futures crate in Chapter 5, Understanding Asynchronous Operations with the Futures Crate.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.48.204