From 96570bb564432934ec5e6ec6f1cb203caf809570 Mon Sep 17 00:00:00 2001 From: Han Xu Date: Thu, 14 May 2020 10:47:42 -0700 Subject: [PATCH] fix documentation for server::Connection --- src/server.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server.rs b/src/server.rs index 59247b5..b6e7394 100644 --- a/src/server.rs +++ b/src/server.rs @@ -23,10 +23,10 @@ //! //! The [`Connection`] instance is used to accept inbound HTTP/2.0 streams. It //! does this by implementing [`futures::Stream`]. When a new stream is -//! received, a call to [`Connection::poll`] will return `(request, response)`. +//! received, a call to [`Connection::accept`] will return `(request, response)`. //! The `request` handle (of type [`http::Request`]) contains the //! HTTP request head as well as provides a way to receive the inbound data -//! stream and the trailers. The `response` handle (of type [`SendStream`]) +//! stream and the trailers. The `response` handle (of type [`SendResponse`]) //! allows responding to the request, stream the response payload, send //! trailers, and send push promises. //! @@ -36,19 +36,19 @@ //! # Managing the connection //! //! The [`Connection`] instance is used to manage connection state. The caller -//! is required to call either [`Connection::poll`] or +//! is required to call either [`Connection::accept`] or //! [`Connection::poll_close`] in order to advance the connection state. Simply //! operating on [`SendStream`] or [`RecvStream`] will have no effect unless the //! connection state is advanced. //! -//! It is not required to call **both** [`Connection::poll`] and +//! It is not required to call **both** [`Connection::accept`] and //! [`Connection::poll_close`]. If the caller is ready to accept a new stream, -//! then only [`Connection::poll`] should be called. When the caller **does +//! then only [`Connection::accept`] should be called. When the caller **does //! not** want to accept a new stream, [`Connection::poll_close`] should be //! called. //! //! The [`Connection`] instance should only be dropped once -//! [`Connection::poll_close`] returns `Ready`. Once [`Connection::poll`] +//! [`Connection::poll_close`] returns `Ready`. Once [`Connection::accept`] //! returns `Ready(None)`, there will no longer be any more inbound streams. At //! this point, only [`Connection::poll_close`] should be called. //!