From a566eb06127b9cf8de822c1a731cf8535d45939a Mon Sep 17 00:00:00 2001 From: Max Fang Date: Thu, 11 Apr 2024 13:10:24 -0700 Subject: [PATCH] doc: minor: Fix `TokioIo` doc The TokioIo docs are confusing when a user intends to use it for adapting a hyper IO trait impl to a Tokio IO trait impl. This commit updates the TokioIo docs to make clear that it is a bidirectional adapter between Tokio's and hyper's IO traits. --- src/rt/tokio.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rt/tokio.rs b/src/rt/tokio.rs index a75c0e3..e5f2eab 100644 --- a/src/rt/tokio.rs +++ b/src/rt/tokio.rs @@ -16,8 +16,9 @@ use pin_project_lite::pin_project; pub struct TokioExecutor {} pin_project! { - /// A wrapping implementing hyper IO traits for a type that - /// implements Tokio's IO traits. + /// A wrapper that implements Tokio's IO traits for an inner type that + /// implements hyper's IO traits, or vice versa (implements hyper's IO + /// traits for a type that implements Tokio's IO traits). #[derive(Debug)] pub struct TokioIo { #[pin] @@ -62,7 +63,7 @@ impl TokioExecutor { // ==== impl TokioIo ===== impl TokioIo { - /// Wrap a type implementing Tokio's IO traits. + /// Wrap a type implementing Tokio's or hyper's IO traits. pub fn new(inner: T) -> Self { Self { inner } }