From 45a841e8c70218feea5d8f8fc77514ad47921d63 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Tue, 26 Jan 2021 03:17:51 -0800 Subject: [PATCH] readd doc comment --- awc/src/response.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/awc/src/response.rs b/awc/src/response.rs index 5d8c3f245..8549a9760 100644 --- a/awc/src/response.rs +++ b/awc/src/response.rs @@ -27,6 +27,8 @@ pub struct ClientResponse { pub(crate) timeout: ResponseTimeout, } +/// helper enum with reusable sleep passed from `SendClientResponse`. +/// See `ClientResponse::_timeout` for reason. pub(crate) enum ResponseTimeout { Disabled(Option>>), Enabled(Option>>), @@ -175,6 +177,9 @@ impl ClientResponse { } } + /// This method does not enable timeout. It's used to pass the boxed `Sleep` from + /// `SendClientRequest` and reuse it's heap allocation together with it's slot in + /// timer wheel. pub(crate) fn _timeout(mut self, timeout: Option>>) -> Self { self.timeout = ResponseTimeout::Disabled(timeout); self