Skip to content

Commit 05e3016

Browse files
[Rust Server] Add Has<Option<Authorization>> bounds on C.
1 parent 1dd6734 commit 05e3016

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

modules/openapi-generator/src/main/resources/rust-server/server-callbacks.mustache

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct Client<S, C> where
2323
Response=Response<BoxBody<Bytes, Infallible>>,
2424
Error=hyper::Error> + Clone + Send + Sync,
2525
S::Future: Send + 'static,
26-
C: Clone + Send + Sync + 'static
26+
C: Clone{{#hasAuthMethods}}+ Has<Option<Authorization>>{{/hasAuthMethods}} + Send + Sync + 'static
2727
{
2828
/// Inner service
2929
client_service: S,
@@ -38,7 +38,7 @@ impl<S, C> fmt::Debug for Client<S, C> where
3838
Response=Response<BoxBody<Bytes, Infallible>>,
3939
Error=hyper::Error> + Clone + Send + Sync,
4040
S::Future: Send + 'static,
41-
C: Clone + Send + Sync + 'static
41+
C: Clone{{#hasAuthMethods}}+ Has<Option<Authorization>>{{/hasAuthMethods}} + Send + Sync + 'static
4242
{
4343
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4444
write!(f, "Client")
@@ -51,7 +51,7 @@ impl<S, C> Clone for Client<S, C> where
5151
Response=Response<BoxBody<Bytes, Infallible>>,
5252
Error=hyper::Error> + Clone + Send + Sync,
5353
S::Future: Send + 'static,
54-
C: Clone + Send + Sync + 'static
54+
C: Clone{{#hasAuthMethods}}+ Has<Option<Authorization>>{{/hasAuthMethods}} + Send + Sync + 'static
5555
{
5656
fn clone(&self) -> Self {
5757
Self {
@@ -63,7 +63,7 @@ impl<S, C> Clone for Client<S, C> where
6363

6464
impl<Connector, C> Client<DropContextService<hyper::client::Client<Connector, Body>, C>, C> where
6565
Connector: hyper::client::connect::Connect + Clone + Send + Sync + 'static,
66-
C: Clone + Send + Sync + 'static
66+
C: Clone{{#hasAuthMethods}}+ Has<Option<Authorization>>{{/hasAuthMethods}} + Send + Sync + 'static
6767
{
6868
/// Create a client with a custom implementation of hyper::client::Connect.
6969
///
@@ -90,7 +90,7 @@ impl<Connector, C> Client<DropContextService<hyper::client::Client<Connector, Bo
9090
}
9191

9292
impl<C> Client<DropContextService<hyper::client::Client<hyper::client::HttpConnector, Body>, C>, C> where
93-
C: Clone + Send + Sync + 'static
93+
C: Clone{{#hasAuthMethods}}+ Has<Option<Authorization>>{{/hasAuthMethods}} + Send + Sync + 'static
9494
{
9595
/// Create an HTTP client.
9696
pub fn new_http() -> Self {
@@ -106,7 +106,7 @@ type HttpsConnector = hyper_tls::HttpsConnector<hyper::client::HttpConnector>;
106106
type HttpsConnector = hyper_openssl::HttpsConnector<hyper::client::HttpConnector>;
107107

108108
impl<C> Client<DropContextService<hyper::client::Client<HttpsConnector, Body>, C>, C> where
109-
C: Clone + Send + Sync + 'static
109+
C: Clone{{#hasAuthMethods}}+ Has<Option<Authorization>>{{/hasAuthMethods}} + Send + Sync + 'static
110110
{
111111
/// Create a client with a TLS connection to the server.
112112
#[cfg(any(target_os = "macos", target_os = "windows", target_os = "ios"))]
@@ -173,7 +173,7 @@ impl<S, C> Client<S, C> where
173173
Response=Response<BoxBody<Bytes, Infallible>>,
174174
Error=hyper::Error> + Clone + Send + Sync,
175175
S::Future: Send + 'static,
176-
C: Clone + Send + Sync + 'static
176+
C: Clone{{#hasAuthMethods}}+ Has<Option<Authorization>>{{/hasAuthMethods}} + Send + Sync + 'static
177177
{
178178
/// Constructor for creating a `Client` by passing in a pre-made `swagger::Service`
179179
///

modules/openapi-generator/src/main/resources/rust-server/server-make-service.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ where
4242
impl<T, C, Target> Clone for MakeService<T, C, Target>
4343
where
4444
T: Api<C> + Clone + Send + 'static,
45-
C: Has<XSpanIdString> + Send + Sync + 'static
45+
C: Has<XSpanIdString> {{#hasAuthMethods}}+ Has<Option<Authorization>>{{/hasAuthMethods}} + Send + Sync + 'static
4646
{
4747
fn clone(&self) -> Self {
4848
Self {

0 commit comments

Comments
 (0)