You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar functions in the Builder return Self rather than &mut Self enabling move semantics, but timeout doesn't, leading to quirky behavior.
// This compiles because `add_service` takes a `&mut Self` and clones it.let router = Server::builder().accept_http1(true).timeout(Duration::from_secs(10)).add_service(my_svc);// This does NOT compile because `accept_http1` takes a `Self` but cannot move or copy it.let router = Server::builder().timeout(Duration::from_secs(10)).accept_http1(true).add_service(my_svc);
Issue #115 changed most of these functions to return Self, but timeout was (re-)introduced in PR #199 and (presumably unintentionally) uses the old behavior of returning &mut Self.
Proposal
Make timeout consistent with other funcs like accept_http1, concurrency_limit_per_connection, etc.
The text was updated successfully, but these errors were encountered:
jdahlq
added a commit
to jdahlq/tonic
that referenced
this issue
Jan 30, 2022
…ilder
transport/server/mod.rs exposes a Builder for the Server, and most of the
Builder functions return Self (a change made for issue hyperium#115), but timeout
returns mut& Self. This change makes timeout consistent with the rest of
the Builder api by returning Self.
Fixes: hyperium#900
Refs: hyperium#115
…ilder
transport/server/mod.rs exposes a Builder for the Server, and most of the
Builder functions return Self (a change made for issue hyperium#115), but timeout
returns mut& Self. This change makes timeout consistent with the rest of
the Builder api by returning Self.
Fixes: hyperium#900
Refs: hyperium#115
Feature Request
Crates
tonic
Motivation
Similar functions in the Builder return
Self
rather than&mut Self
enabling move semantics, buttimeout
doesn't, leading to quirky behavior.Issue #115 changed most of these functions to return
Self
, buttimeout
was (re-)introduced in PR #199 and (presumably unintentionally) uses the old behavior of returning&mut Self
.Proposal
Make
timeout
consistent with other funcs likeaccept_http1
,concurrency_limit_per_connection
, etc.The text was updated successfully, but these errors were encountered: