From 7ea854b6957e90fdba66b4b1b313f398fffdcc36 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Thu, 28 Oct 2021 16:24:07 +0200 Subject: [PATCH] chore: Point to Request::set_timeout in Endpoint::timeout docs (#817) --- tonic/src/transport/channel/endpoint.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tonic/src/transport/channel/endpoint.rs b/tonic/src/transport/channel/endpoint.rs index e0a4965..3a0b5b8 100644 --- a/tonic/src/transport/channel/endpoint.rs +++ b/tonic/src/transport/channel/endpoint.rs @@ -113,6 +113,14 @@ impl Endpoint { /// # let mut builder = Endpoint::from_static("https://example.com"); /// builder.timeout(Duration::from_secs(5)); /// ``` + /// + /// # Notes + /// + /// This does **not** set the timeout metadata (`grpc-timeout` header) on + /// the request, meaning the server will not be informed of this timeout, + /// for that use [`Request::set_timeout`]. + /// + /// [`Request::set_timeout`]: crate::Request::set_timeout pub fn timeout(self, dur: Duration) -> Self { Endpoint { timeout: Some(dur),