• Home
  • Raw
  • Download

Lines Matching refs:push_str

113     buf.push_str("const ");  in generate_method()
114 buf.push_str(&name); in generate_method()
115 buf.push_str(": "); in generate_method()
116 buf.push_str(&ty); in generate_method()
117 buf.push_str(" = "); in generate_method()
130 buf.push_str(&fq_grpc("Method")); in generate_method_body()
140 buf.push_str("};\n"); in generate_method_body()
156 buf.push_str(name); in generate_field_init()
157 buf.push_str(": "); in generate_field_init()
158 buf.push_str(value); in generate_field_init()
159 buf.push_str(", "); in generate_field_init()
164 buf.push_str("#[derive(Clone)]\n"); in generate_client()
165 buf.push_str("pub struct "); in generate_client()
166 buf.push_str(&client_name); in generate_client()
167 buf.push_str(" { client: ::grpcio::Client }\n"); in generate_client()
169 buf.push_str("impl "); in generate_client()
170 buf.push_str(&client_name); in generate_client()
171 buf.push_str(" {\n"); in generate_client()
175 buf.push_str("}\n") in generate_client()
179 buf.push_str("pub fn new(channel: ::grpcio::Channel) -> Self { "); in generate_ctor()
180 buf.push_str(client_name); in generate_ctor()
181 buf.push_str(" { client: ::grpcio::Client::new(channel) }"); in generate_ctor()
182 buf.push_str("}\n"); in generate_ctor()
366 buf.push_str("pub fn "); in generate()
368 buf.push_str(self.method_name); in generate()
370 buf.push_str("_async"); in generate()
373 buf.push_str("_opt"); in generate()
376 buf.push_str("(&self"); in generate()
378 buf.push_str(", req: &"); in generate()
379 buf.push_str(req); in generate()
382 buf.push_str(", opt: "); in generate()
383 buf.push_str(&fq_grpc("CallOption")); in generate()
385 buf.push_str(") -> "); in generate()
387 buf.push_str(&fq_grpc("Result")); in generate()
393 buf.push_str(rt); in generate()
399 buf.push_str("> { "); in generate()
405 buf.push_str(" }\n"); in generate()
410 buf.push_str("self."); in generate_opt_body()
411 buf.push_str(self.method_name); in generate_opt_body()
413 buf.push_str("_async"); in generate_opt_body()
415 buf.push_str("_opt("); in generate_opt_body()
417 buf.push_str("req, "); in generate_opt_body()
419 buf.push_str(&fq_grpc("CallOption::default()")); in generate_opt_body()
425 buf.push_str("self.client."); in generate_inner_body()
426 buf.push_str(self.inner_method_name); in generate_inner_body()
428 buf.push_str("_async"); in generate_inner_body()
430 buf.push_str("(&"); in generate_inner_body()
431 buf.push_str(self.data_name); in generate_inner_body()
433 buf.push_str(", req"); in generate_inner_body()
435 buf.push_str(", opt)"); in generate_inner_body()
440 buf.push_str( in generate_spawn()
449 buf.push_str("pub trait "); in generate_server()
450 buf.push_str(&service.name); in generate_server()
451 buf.push_str(" {\n"); in generate_server()
453 buf.push_str("}\n"); in generate_server()
455 buf.push_str("pub fn create_"); in generate_server()
456 buf.push_str(&to_snake_case(&service.name)); in generate_server()
457 buf.push_str("<S: "); in generate_server()
458 buf.push_str(&service.name); in generate_server()
459 buf.push_str(" + Send + Clone + 'static>(s: S) -> "); in generate_server()
460 buf.push_str(&fq_grpc("Service")); in generate_server()
461 buf.push_str(" {\n"); in generate_server()
462 buf.push_str("let mut builder = ::grpcio::ServiceBuilder::new();\n"); in generate_server()
465 buf.push_str("let mut instance = s.clone();\n"); in generate_server()
469 buf.push_str("let mut instance = s;\n"); in generate_server()
476 buf.push_str("builder.build()\n"); in generate_server()
477 buf.push_str("}\n"); in generate_server()
509 buf.push_str("fn "); in generate_server_method()
510 buf.push_str(&method.name); in generate_server_method()
511 buf.push_str("(&mut self, ctx: "); in generate_server_method()
512 buf.push_str(&fq_grpc("RpcContext")); in generate_server_method()
513 buf.push_str(", "); in generate_server_method()
514 buf.push_str(request_arg); in generate_server_method()
515 buf.push_str(", sink: "); in generate_server_method()
516 buf.push_str(&fq_grpc(response_type)); in generate_server_method()
518 buf.push_str(&method.output_type); in generate_server_method()
520 buf.push_str(");\n"); in generate_server_method()
531 buf.push_str("builder = builder."); in generate_method_bind()
532 buf.push_str(add_name); in generate_method_bind()
533 buf.push_str("(&"); in generate_method_bind()
534 buf.push_str(&const_method_name(service_name, method)); in generate_method_bind()
535 buf.push_str(", move |ctx, req, resp| instance."); in generate_method_bind()
536 buf.push_str(&method.name); in generate_method_bind()
537 buf.push_str("(ctx, req, resp));\n"); in generate_method_bind()