Skip to content

Commit 940f6aa

Browse files
committed
chore: rustfmt
1 parent 649f8fc commit 940f6aa

File tree

1 file changed

+89
-47
lines changed

1 file changed

+89
-47
lines changed

dataplane/api-server/src/backends.rs

Lines changed: 89 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ pub struct InterfaceIndexConfirmation {
4545
/// Generated client implementations.
4646
pub mod backends_client {
4747
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
48-
use tonic::codegen::http::Uri;
4948
use tonic::codegen::*;
49+
use tonic::codegen::http::Uri;
5050
#[derive(Debug, Clone)]
5151
pub struct BackendsClient<T> {
5252
inner: tonic::client::Grpc<T>,
@@ -90,8 +90,9 @@ pub mod backends_client {
9090
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
9191
>,
9292
>,
93-
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
94-
Into<StdError> + Send + Sync,
93+
<T as tonic::codegen::Service<
94+
http::Request<tonic::body::BoxBody>,
95+
>>::Error: Into<StdError> + Send + Sync,
9596
{
9697
BackendsClient::new(InterceptedService::new(inner, interceptor))
9798
}
@@ -129,16 +130,23 @@ pub mod backends_client {
129130
pub async fn get_interface_index(
130131
&mut self,
131132
request: impl tonic::IntoRequest<super::PodIp>,
132-
) -> std::result::Result<tonic::Response<super::InterfaceIndexConfirmation>, tonic::Status>
133-
{
134-
self.inner.ready().await.map_err(|e| {
135-
tonic::Status::new(
136-
tonic::Code::Unknown,
137-
format!("Service was not ready: {}", e.into()),
138-
)
139-
})?;
133+
) -> std::result::Result<
134+
tonic::Response<super::InterfaceIndexConfirmation>,
135+
tonic::Status,
136+
> {
137+
self.inner
138+
.ready()
139+
.await
140+
.map_err(|e| {
141+
tonic::Status::new(
142+
tonic::Code::Unknown,
143+
format!("Service was not ready: {}", e.into()),
144+
)
145+
})?;
140146
let codec = tonic::codec::ProstCodec::default();
141-
let path = http::uri::PathAndQuery::from_static("/backends.backends/GetInterfaceIndex");
147+
let path = http::uri::PathAndQuery::from_static(
148+
"/backends.backends/GetInterfaceIndex",
149+
);
142150
let mut req = request.into_request();
143151
req.extensions_mut()
144152
.insert(GrpcMethod::new("backends.backends", "GetInterfaceIndex"));
@@ -148,34 +156,38 @@ pub mod backends_client {
148156
&mut self,
149157
request: impl tonic::IntoRequest<super::Targets>,
150158
) -> std::result::Result<tonic::Response<super::Confirmation>, tonic::Status> {
151-
self.inner.ready().await.map_err(|e| {
152-
tonic::Status::new(
153-
tonic::Code::Unknown,
154-
format!("Service was not ready: {}", e.into()),
155-
)
156-
})?;
159+
self.inner
160+
.ready()
161+
.await
162+
.map_err(|e| {
163+
tonic::Status::new(
164+
tonic::Code::Unknown,
165+
format!("Service was not ready: {}", e.into()),
166+
)
167+
})?;
157168
let codec = tonic::codec::ProstCodec::default();
158169
let path = http::uri::PathAndQuery::from_static("/backends.backends/Update");
159170
let mut req = request.into_request();
160-
req.extensions_mut()
161-
.insert(GrpcMethod::new("backends.backends", "Update"));
171+
req.extensions_mut().insert(GrpcMethod::new("backends.backends", "Update"));
162172
self.inner.unary(req, path, codec).await
163173
}
164174
pub async fn delete(
165175
&mut self,
166176
request: impl tonic::IntoRequest<super::Vip>,
167177
) -> std::result::Result<tonic::Response<super::Confirmation>, tonic::Status> {
168-
self.inner.ready().await.map_err(|e| {
169-
tonic::Status::new(
170-
tonic::Code::Unknown,
171-
format!("Service was not ready: {}", e.into()),
172-
)
173-
})?;
178+
self.inner
179+
.ready()
180+
.await
181+
.map_err(|e| {
182+
tonic::Status::new(
183+
tonic::Code::Unknown,
184+
format!("Service was not ready: {}", e.into()),
185+
)
186+
})?;
174187
let codec = tonic::codec::ProstCodec::default();
175188
let path = http::uri::PathAndQuery::from_static("/backends.backends/Delete");
176189
let mut req = request.into_request();
177-
req.extensions_mut()
178-
.insert(GrpcMethod::new("backends.backends", "Delete"));
190+
req.extensions_mut().insert(GrpcMethod::new("backends.backends", "Delete"));
179191
self.inner.unary(req, path, codec).await
180192
}
181193
}
@@ -190,7 +202,10 @@ pub mod backends_server {
190202
async fn get_interface_index(
191203
&self,
192204
request: tonic::Request<super::PodIp>,
193-
) -> std::result::Result<tonic::Response<super::InterfaceIndexConfirmation>, tonic::Status>;
205+
) -> std::result::Result<
206+
tonic::Response<super::InterfaceIndexConfirmation>,
207+
tonic::Status,
208+
>;
194209
async fn update(
195210
&self,
196211
request: tonic::Request<super::Targets>,
@@ -223,7 +238,10 @@ pub mod backends_server {
223238
max_encoding_message_size: None,
224239
}
225240
}
226-
pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
241+
pub fn with_interceptor<F>(
242+
inner: T,
243+
interceptor: F,
244+
) -> InterceptedService<Self, F>
227245
where
228246
F: tonic::service::Interceptor,
229247
{
@@ -279,12 +297,21 @@ pub mod backends_server {
279297
"/backends.backends/GetInterfaceIndex" => {
280298
#[allow(non_camel_case_types)]
281299
struct GetInterfaceIndexSvc<T: Backends>(pub Arc<T>);
282-
impl<T: Backends> tonic::server::UnaryService<super::PodIp> for GetInterfaceIndexSvc<T> {
300+
impl<T: Backends> tonic::server::UnaryService<super::PodIp>
301+
for GetInterfaceIndexSvc<T> {
283302
type Response = super::InterfaceIndexConfirmation;
284-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
285-
fn call(&mut self, request: tonic::Request<super::PodIp>) -> Self::Future {
303+
type Future = BoxFuture<
304+
tonic::Response<Self::Response>,
305+
tonic::Status,
306+
>;
307+
fn call(
308+
&mut self,
309+
request: tonic::Request<super::PodIp>,
310+
) -> Self::Future {
286311
let inner = Arc::clone(&self.0);
287-
let fut = async move { (*inner).get_interface_index(request).await };
312+
let fut = async move {
313+
(*inner).get_interface_index(request).await
314+
};
288315
Box::pin(fut)
289316
}
290317
}
@@ -314,9 +341,13 @@ pub mod backends_server {
314341
"/backends.backends/Update" => {
315342
#[allow(non_camel_case_types)]
316343
struct UpdateSvc<T: Backends>(pub Arc<T>);
317-
impl<T: Backends> tonic::server::UnaryService<super::Targets> for UpdateSvc<T> {
344+
impl<T: Backends> tonic::server::UnaryService<super::Targets>
345+
for UpdateSvc<T> {
318346
type Response = super::Confirmation;
319-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
347+
type Future = BoxFuture<
348+
tonic::Response<Self::Response>,
349+
tonic::Status,
350+
>;
320351
fn call(
321352
&mut self,
322353
request: tonic::Request<super::Targets>,
@@ -352,10 +383,17 @@ pub mod backends_server {
352383
"/backends.backends/Delete" => {
353384
#[allow(non_camel_case_types)]
354385
struct DeleteSvc<T: Backends>(pub Arc<T>);
355-
impl<T: Backends> tonic::server::UnaryService<super::Vip> for DeleteSvc<T> {
386+
impl<T: Backends> tonic::server::UnaryService<super::Vip>
387+
for DeleteSvc<T> {
356388
type Response = super::Confirmation;
357-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
358-
fn call(&mut self, request: tonic::Request<super::Vip>) -> Self::Future {
389+
type Future = BoxFuture<
390+
tonic::Response<Self::Response>,
391+
tonic::Status,
392+
>;
393+
fn call(
394+
&mut self,
395+
request: tonic::Request<super::Vip>,
396+
) -> Self::Future {
359397
let inner = Arc::clone(&self.0);
360398
let fut = async move { (*inner).delete(request).await };
361399
Box::pin(fut)
@@ -384,14 +422,18 @@ pub mod backends_server {
384422
};
385423
Box::pin(fut)
386424
}
387-
_ => Box::pin(async move {
388-
Ok(http::Response::builder()
389-
.status(200)
390-
.header("grpc-status", "12")
391-
.header("content-type", "application/grpc")
392-
.body(empty_body())
393-
.unwrap())
394-
}),
425+
_ => {
426+
Box::pin(async move {
427+
Ok(
428+
http::Response::builder()
429+
.status(200)
430+
.header("grpc-status", "12")
431+
.header("content-type", "application/grpc")
432+
.body(empty_body())
433+
.unwrap(),
434+
)
435+
})
436+
}
395437
}
396438
}
397439
}

0 commit comments

Comments
 (0)