grpc_testing_benchmark_service.grpc.swift 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. // Copyright 2015 gRPC authors.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /// An integration test service that covers all the method signature permutations
  15. /// of unary/streaming requests/responses.
  16. // DO NOT EDIT.
  17. // swift-format-ignore-file
  18. //
  19. // Generated by the gRPC Swift generator plugin for the protocol buffer compiler.
  20. // Source: grpc/testing/benchmark_service.proto
  21. //
  22. // For information on using the generated types, please see the documentation:
  23. // https://github.com/grpc/grpc-swift
  24. import GRPCCore
  25. import GRPCProtobuf
  26. internal enum Grpc_Testing_BenchmarkService {
  27. internal enum Method {
  28. internal enum UnaryCall {
  29. internal typealias Input = Grpc_Testing_SimpleRequest
  30. internal typealias Output = Grpc_Testing_SimpleResponse
  31. internal static let descriptor = MethodDescriptor(
  32. service: "grpc.testing.BenchmarkService",
  33. method: "UnaryCall"
  34. )
  35. }
  36. internal enum StreamingCall {
  37. internal typealias Input = Grpc_Testing_SimpleRequest
  38. internal typealias Output = Grpc_Testing_SimpleResponse
  39. internal static let descriptor = MethodDescriptor(
  40. service: "grpc.testing.BenchmarkService",
  41. method: "StreamingCall"
  42. )
  43. }
  44. internal enum StreamingFromClient {
  45. internal typealias Input = Grpc_Testing_SimpleRequest
  46. internal typealias Output = Grpc_Testing_SimpleResponse
  47. internal static let descriptor = MethodDescriptor(
  48. service: "grpc.testing.BenchmarkService",
  49. method: "StreamingFromClient"
  50. )
  51. }
  52. internal enum StreamingFromServer {
  53. internal typealias Input = Grpc_Testing_SimpleRequest
  54. internal typealias Output = Grpc_Testing_SimpleResponse
  55. internal static let descriptor = MethodDescriptor(
  56. service: "grpc.testing.BenchmarkService",
  57. method: "StreamingFromServer"
  58. )
  59. }
  60. internal enum StreamingBothWays {
  61. internal typealias Input = Grpc_Testing_SimpleRequest
  62. internal typealias Output = Grpc_Testing_SimpleResponse
  63. internal static let descriptor = MethodDescriptor(
  64. service: "grpc.testing.BenchmarkService",
  65. method: "StreamingBothWays"
  66. )
  67. }
  68. internal static let descriptors: [MethodDescriptor] = [
  69. UnaryCall.descriptor,
  70. StreamingCall.descriptor,
  71. StreamingFromClient.descriptor,
  72. StreamingFromServer.descriptor,
  73. StreamingBothWays.descriptor
  74. ]
  75. }
  76. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  77. internal typealias StreamingServiceProtocol = Grpc_Testing_BenchmarkServiceStreamingServiceProtocol
  78. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  79. internal typealias ServiceProtocol = Grpc_Testing_BenchmarkServiceServiceProtocol
  80. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  81. internal typealias ClientProtocol = Grpc_Testing_BenchmarkServiceClientProtocol
  82. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  83. internal typealias Client = Grpc_Testing_BenchmarkServiceClient
  84. }
  85. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  86. internal protocol Grpc_Testing_BenchmarkServiceStreamingServiceProtocol: GRPCCore.RegistrableRPCService {
  87. /// One request followed by one response.
  88. /// The server returns the client payload as-is.
  89. func unaryCall(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output>
  90. /// Repeated sequence of one request followed by one response.
  91. /// Should be called streaming ping-pong
  92. /// The server returns the client payload as-is on each response
  93. func streamingCall(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Output>
  94. /// Single-sided unbounded streaming from client to server
  95. /// The server returns the client payload as-is once the client does WritesDone
  96. func streamingFromClient(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output>
  97. /// Single-sided unbounded streaming from server to client
  98. /// The server repeatedly returns the client payload as-is
  99. func streamingFromServer(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output>
  100. /// Two-sided unbounded streaming between server to client
  101. /// Both sides send the content of their own choice to the other
  102. func streamingBothWays(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Output>
  103. }
  104. /// Conformance to `GRPCCore.RegistrableRPCService`.
  105. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  106. extension Grpc_Testing_BenchmarkService.StreamingServiceProtocol {
  107. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  108. internal func registerMethods(with router: inout GRPCCore.RPCRouter) {
  109. router.registerHandler(
  110. forMethod: Grpc_Testing_BenchmarkService.Method.UnaryCall.descriptor,
  111. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>(),
  112. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output>(),
  113. handler: { request in
  114. try await self.unaryCall(request: request)
  115. }
  116. )
  117. router.registerHandler(
  118. forMethod: Grpc_Testing_BenchmarkService.Method.StreamingCall.descriptor,
  119. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingCall.Input>(),
  120. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.StreamingCall.Output>(),
  121. handler: { request in
  122. try await self.streamingCall(request: request)
  123. }
  124. )
  125. router.registerHandler(
  126. forMethod: Grpc_Testing_BenchmarkService.Method.StreamingFromClient.descriptor,
  127. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>(),
  128. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output>(),
  129. handler: { request in
  130. try await self.streamingFromClient(request: request)
  131. }
  132. )
  133. router.registerHandler(
  134. forMethod: Grpc_Testing_BenchmarkService.Method.StreamingFromServer.descriptor,
  135. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>(),
  136. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output>(),
  137. handler: { request in
  138. try await self.streamingFromServer(request: request)
  139. }
  140. )
  141. router.registerHandler(
  142. forMethod: Grpc_Testing_BenchmarkService.Method.StreamingBothWays.descriptor,
  143. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Input>(),
  144. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Output>(),
  145. handler: { request in
  146. try await self.streamingBothWays(request: request)
  147. }
  148. )
  149. }
  150. }
  151. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  152. internal protocol Grpc_Testing_BenchmarkServiceServiceProtocol: Grpc_Testing_BenchmarkService.StreamingServiceProtocol {
  153. /// One request followed by one response.
  154. /// The server returns the client payload as-is.
  155. func unaryCall(request: ServerRequest.Single<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>) async throws -> ServerResponse.Single<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output>
  156. /// Repeated sequence of one request followed by one response.
  157. /// Should be called streaming ping-pong
  158. /// The server returns the client payload as-is on each response
  159. func streamingCall(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Output>
  160. /// Single-sided unbounded streaming from client to server
  161. /// The server returns the client payload as-is once the client does WritesDone
  162. func streamingFromClient(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>) async throws -> ServerResponse.Single<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output>
  163. /// Single-sided unbounded streaming from server to client
  164. /// The server repeatedly returns the client payload as-is
  165. func streamingFromServer(request: ServerRequest.Single<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output>
  166. /// Two-sided unbounded streaming between server to client
  167. /// Both sides send the content of their own choice to the other
  168. func streamingBothWays(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Output>
  169. }
  170. /// Partial conformance to `Grpc_Testing_BenchmarkServiceStreamingServiceProtocol`.
  171. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  172. extension Grpc_Testing_BenchmarkService.ServiceProtocol {
  173. internal func unaryCall(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output> {
  174. let response = try await self.unaryCall(request: ServerRequest.Single(stream: request))
  175. return ServerResponse.Stream(single: response)
  176. }
  177. internal func streamingFromClient(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output> {
  178. let response = try await self.streamingFromClient(request: request)
  179. return ServerResponse.Stream(single: response)
  180. }
  181. internal func streamingFromServer(request: ServerRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>) async throws -> ServerResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output> {
  182. let response = try await self.streamingFromServer(request: ServerRequest.Single(stream: request))
  183. return response
  184. }
  185. }
  186. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  187. internal protocol Grpc_Testing_BenchmarkServiceClientProtocol: Sendable {
  188. /// One request followed by one response.
  189. /// The server returns the client payload as-is.
  190. func unaryCall<R>(
  191. request: ClientRequest.Single<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>,
  192. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>,
  193. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output>,
  194. options: CallOptions,
  195. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output>) async throws -> R
  196. ) async throws -> R where R: Sendable
  197. /// Repeated sequence of one request followed by one response.
  198. /// Should be called streaming ping-pong
  199. /// The server returns the client payload as-is on each response
  200. func streamingCall<R>(
  201. request: ClientRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Input>,
  202. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.StreamingCall.Input>,
  203. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingCall.Output>,
  204. options: CallOptions,
  205. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Output>) async throws -> R
  206. ) async throws -> R where R: Sendable
  207. /// Single-sided unbounded streaming from client to server
  208. /// The server returns the client payload as-is once the client does WritesDone
  209. func streamingFromClient<R>(
  210. request: ClientRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>,
  211. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>,
  212. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output>,
  213. options: CallOptions,
  214. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output>) async throws -> R
  215. ) async throws -> R where R: Sendable
  216. /// Single-sided unbounded streaming from server to client
  217. /// The server repeatedly returns the client payload as-is
  218. func streamingFromServer<R>(
  219. request: ClientRequest.Single<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>,
  220. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>,
  221. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output>,
  222. options: CallOptions,
  223. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output>) async throws -> R
  224. ) async throws -> R where R: Sendable
  225. /// Two-sided unbounded streaming between server to client
  226. /// Both sides send the content of their own choice to the other
  227. func streamingBothWays<R>(
  228. request: ClientRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Input>,
  229. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Input>,
  230. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Output>,
  231. options: CallOptions,
  232. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Output>) async throws -> R
  233. ) async throws -> R where R: Sendable
  234. }
  235. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  236. extension Grpc_Testing_BenchmarkService.ClientProtocol {
  237. internal func unaryCall<R>(
  238. request: ClientRequest.Single<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>,
  239. options: CallOptions = .defaults,
  240. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output>) async throws -> R
  241. ) async throws -> R where R: Sendable {
  242. try await self.unaryCall(
  243. request: request,
  244. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>(),
  245. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output>(),
  246. options: options,
  247. body
  248. )
  249. }
  250. internal func streamingCall<R>(
  251. request: ClientRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Input>,
  252. options: CallOptions = .defaults,
  253. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Output>) async throws -> R
  254. ) async throws -> R where R: Sendable {
  255. try await self.streamingCall(
  256. request: request,
  257. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.StreamingCall.Input>(),
  258. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingCall.Output>(),
  259. options: options,
  260. body
  261. )
  262. }
  263. internal func streamingFromClient<R>(
  264. request: ClientRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>,
  265. options: CallOptions = .defaults,
  266. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output>) async throws -> R
  267. ) async throws -> R where R: Sendable {
  268. try await self.streamingFromClient(
  269. request: request,
  270. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>(),
  271. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output>(),
  272. options: options,
  273. body
  274. )
  275. }
  276. internal func streamingFromServer<R>(
  277. request: ClientRequest.Single<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>,
  278. options: CallOptions = .defaults,
  279. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output>) async throws -> R
  280. ) async throws -> R where R: Sendable {
  281. try await self.streamingFromServer(
  282. request: request,
  283. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>(),
  284. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output>(),
  285. options: options,
  286. body
  287. )
  288. }
  289. internal func streamingBothWays<R>(
  290. request: ClientRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Input>,
  291. options: CallOptions = .defaults,
  292. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Output>) async throws -> R
  293. ) async throws -> R where R: Sendable {
  294. try await self.streamingBothWays(
  295. request: request,
  296. serializer: ProtobufSerializer<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Input>(),
  297. deserializer: ProtobufDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Output>(),
  298. options: options,
  299. body
  300. )
  301. }
  302. }
  303. @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
  304. internal struct Grpc_Testing_BenchmarkServiceClient: Grpc_Testing_BenchmarkService.ClientProtocol {
  305. private let client: GRPCCore.GRPCClient
  306. internal init(client: GRPCCore.GRPCClient) {
  307. self.client = client
  308. }
  309. /// One request followed by one response.
  310. /// The server returns the client payload as-is.
  311. internal func unaryCall<R>(
  312. request: ClientRequest.Single<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>,
  313. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.UnaryCall.Input>,
  314. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output>,
  315. options: CallOptions = .defaults,
  316. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_BenchmarkService.Method.UnaryCall.Output>) async throws -> R
  317. ) async throws -> R where R: Sendable {
  318. try await self.client.unary(
  319. request: request,
  320. descriptor: Grpc_Testing_BenchmarkService.Method.UnaryCall.descriptor,
  321. serializer: serializer,
  322. deserializer: deserializer,
  323. options: options,
  324. handler: body
  325. )
  326. }
  327. /// Repeated sequence of one request followed by one response.
  328. /// Should be called streaming ping-pong
  329. /// The server returns the client payload as-is on each response
  330. internal func streamingCall<R>(
  331. request: ClientRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Input>,
  332. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.StreamingCall.Input>,
  333. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingCall.Output>,
  334. options: CallOptions = .defaults,
  335. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingCall.Output>) async throws -> R
  336. ) async throws -> R where R: Sendable {
  337. try await self.client.bidirectionalStreaming(
  338. request: request,
  339. descriptor: Grpc_Testing_BenchmarkService.Method.StreamingCall.descriptor,
  340. serializer: serializer,
  341. deserializer: deserializer,
  342. options: options,
  343. handler: body
  344. )
  345. }
  346. /// Single-sided unbounded streaming from client to server
  347. /// The server returns the client payload as-is once the client does WritesDone
  348. internal func streamingFromClient<R>(
  349. request: ClientRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>,
  350. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Input>,
  351. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output>,
  352. options: CallOptions = .defaults,
  353. _ body: @Sendable @escaping (ClientResponse.Single<Grpc_Testing_BenchmarkService.Method.StreamingFromClient.Output>) async throws -> R
  354. ) async throws -> R where R: Sendable {
  355. try await self.client.clientStreaming(
  356. request: request,
  357. descriptor: Grpc_Testing_BenchmarkService.Method.StreamingFromClient.descriptor,
  358. serializer: serializer,
  359. deserializer: deserializer,
  360. options: options,
  361. handler: body
  362. )
  363. }
  364. /// Single-sided unbounded streaming from server to client
  365. /// The server repeatedly returns the client payload as-is
  366. internal func streamingFromServer<R>(
  367. request: ClientRequest.Single<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>,
  368. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Input>,
  369. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output>,
  370. options: CallOptions = .defaults,
  371. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingFromServer.Output>) async throws -> R
  372. ) async throws -> R where R: Sendable {
  373. try await self.client.serverStreaming(
  374. request: request,
  375. descriptor: Grpc_Testing_BenchmarkService.Method.StreamingFromServer.descriptor,
  376. serializer: serializer,
  377. deserializer: deserializer,
  378. options: options,
  379. handler: body
  380. )
  381. }
  382. /// Two-sided unbounded streaming between server to client
  383. /// Both sides send the content of their own choice to the other
  384. internal func streamingBothWays<R>(
  385. request: ClientRequest.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Input>,
  386. serializer: some MessageSerializer<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Input>,
  387. deserializer: some MessageDeserializer<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Output>,
  388. options: CallOptions = .defaults,
  389. _ body: @Sendable @escaping (ClientResponse.Stream<Grpc_Testing_BenchmarkService.Method.StreamingBothWays.Output>) async throws -> R
  390. ) async throws -> R where R: Sendable {
  391. try await self.client.bidirectionalStreaming(
  392. request: request,
  393. descriptor: Grpc_Testing_BenchmarkService.Method.StreamingBothWays.descriptor,
  394. serializer: serializer,
  395. deserializer: deserializer,
  396. options: options,
  397. handler: body
  398. )
  399. }
  400. }