tensorflow_serving_client/
session_service_grpc.rs1#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![cfg_attr(rustfmt, rustfmt_skip)]
9
10#![allow(box_pointers)]
11#![allow(dead_code)]
12#![allow(missing_docs)]
13#![allow(non_camel_case_types)]
14#![allow(non_snake_case)]
15#![allow(non_upper_case_globals)]
16#![allow(trivial_casts)]
17#![allow(unsafe_code)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20
21const METHOD_SESSION_SERVICE_SESSION_RUN: ::grpcio::Method<super::session_service::SessionRunRequest, super::session_service::SessionRunResponse> = ::grpcio::Method {
22 ty: ::grpcio::MethodType::Unary,
23 name: "/tensorflow.serving.SessionService/SessionRun",
24 req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
25 resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
26};
27
28#[derive(Clone)]
29pub struct SessionServiceClient {
30 client: ::grpcio::Client,
31}
32
33impl SessionServiceClient {
34 pub fn new(channel: ::grpcio::Channel) -> Self {
35 SessionServiceClient {
36 client: ::grpcio::Client::new(channel),
37 }
38 }
39
40 pub fn session_run_opt(&self, req: &super::session_service::SessionRunRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<super::session_service::SessionRunResponse> {
41 self.client.unary_call(&METHOD_SESSION_SERVICE_SESSION_RUN, req, opt)
42 }
43
44 pub fn session_run(&self, req: &super::session_service::SessionRunRequest) -> ::grpcio::Result<super::session_service::SessionRunResponse> {
45 self.session_run_opt(req, ::grpcio::CallOption::default())
46 }
47
48 pub fn session_run_async_opt(&self, req: &super::session_service::SessionRunRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::session_service::SessionRunResponse>> {
49 self.client.unary_call_async(&METHOD_SESSION_SERVICE_SESSION_RUN, req, opt)
50 }
51
52 pub fn session_run_async(&self, req: &super::session_service::SessionRunRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver<super::session_service::SessionRunResponse>> {
53 self.session_run_async_opt(req, ::grpcio::CallOption::default())
54 }
55 pub fn spawn<F>(&self, f: F) where F: ::futures::Future<Output = ()> + Send + 'static {
56 self.client.spawn(f)
57 }
58}
59
60pub trait SessionService {
61 fn session_run(&mut self, ctx: ::grpcio::RpcContext, req: super::session_service::SessionRunRequest, sink: ::grpcio::UnarySink<super::session_service::SessionRunResponse>);
62}
63
64pub fn create_session_service<S: SessionService + Send + Clone + 'static>(s: S) -> ::grpcio::Service {
65 let mut builder = ::grpcio::ServiceBuilder::new();
66 let mut instance = s;
67 builder = builder.add_unary_handler(&METHOD_SESSION_SERVICE_SESSION_RUN, move |ctx, req, resp| {
68 instance.session_run(ctx, req, resp)
69 });
70 builder.build()
71}