Skip to main content

onekey_solana_client_rust/pb/
serverpb.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct SendRequest {
4    #[prost(string, tag = "1")]
5    pub transaction: ::prost::alloc::string::String,
6    #[prost(string, tag = "2")]
7    pub mode: ::prost::alloc::string::String,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct SendResponse {
11    #[prost(string, tag = "1")]
12    pub signature: ::prost::alloc::string::String,
13}
14#[derive(Clone, Copy, PartialEq, ::prost::Message)]
15pub struct HealthRequest {}
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct HealthResponse {
18    #[prost(string, tag = "1")]
19    pub status: ::prost::alloc::string::String,
20}
21/// Generated client implementations.
22pub mod server_client {
23    #![allow(
24        unused_variables,
25        dead_code,
26        missing_docs,
27        clippy::wildcard_imports,
28        clippy::let_unit_value,
29    )]
30    use tonic::codegen::*;
31    use tonic::codegen::http::Uri;
32    #[derive(Debug, Clone)]
33    pub struct ServerClient<T> {
34        inner: tonic::client::Grpc<T>,
35    }
36    impl ServerClient<tonic::transport::Channel> {
37        /// Attempt to create a new client by connecting to a given endpoint.
38        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
39        where
40            D: TryInto<tonic::transport::Endpoint>,
41            D::Error: Into<StdError>,
42        {
43            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
44            Ok(Self::new(conn))
45        }
46    }
47    impl<T> ServerClient<T>
48    where
49        T: tonic::client::GrpcService<tonic::body::Body>,
50        T::Error: Into<StdError>,
51        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
52        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
53    {
54        pub fn new(inner: T) -> Self {
55            let inner = tonic::client::Grpc::new(inner);
56            Self { inner }
57        }
58        pub fn with_origin(inner: T, origin: Uri) -> Self {
59            let inner = tonic::client::Grpc::with_origin(inner, origin);
60            Self { inner }
61        }
62        pub fn with_interceptor<F>(
63            inner: T,
64            interceptor: F,
65        ) -> ServerClient<InterceptedService<T, F>>
66        where
67            F: tonic::service::Interceptor,
68            T::ResponseBody: Default,
69            T: tonic::codegen::Service<
70                http::Request<tonic::body::Body>,
71                Response = http::Response<
72                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
73                >,
74            >,
75            <T as tonic::codegen::Service<
76                http::Request<tonic::body::Body>,
77            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
78        {
79            ServerClient::new(InterceptedService::new(inner, interceptor))
80        }
81        /// Compress requests with the given encoding.
82        ///
83        /// This requires the server to support it otherwise it might respond with an
84        /// error.
85        #[must_use]
86        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
87            self.inner = self.inner.send_compressed(encoding);
88            self
89        }
90        /// Enable decompressing responses.
91        #[must_use]
92        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
93            self.inner = self.inner.accept_compressed(encoding);
94            self
95        }
96        /// Limits the maximum size of a decoded message.
97        ///
98        /// Default: `4MB`
99        #[must_use]
100        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
101            self.inner = self.inner.max_decoding_message_size(limit);
102            self
103        }
104        /// Limits the maximum size of an encoded message.
105        ///
106        /// Default: `usize::MAX`
107        #[must_use]
108        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
109            self.inner = self.inner.max_encoding_message_size(limit);
110            self
111        }
112        pub async fn send_transaction(
113            &mut self,
114            request: impl tonic::IntoRequest<super::SendRequest>,
115        ) -> std::result::Result<tonic::Response<super::SendResponse>, tonic::Status> {
116            self.inner
117                .ready()
118                .await
119                .map_err(|e| {
120                    tonic::Status::unknown(
121                        format!("Service was not ready: {}", e.into()),
122                    )
123                })?;
124            let codec = tonic::codec::ProstCodec::default();
125            let path = http::uri::PathAndQuery::from_static(
126                "/serverpb.Server/SendTransaction",
127            );
128            let mut req = request.into_request();
129            req.extensions_mut()
130                .insert(GrpcMethod::new("serverpb.Server", "SendTransaction"));
131            self.inner.unary(req, path, codec).await
132        }
133        pub async fn get_health(
134            &mut self,
135            request: impl tonic::IntoRequest<super::HealthRequest>,
136        ) -> std::result::Result<tonic::Response<super::HealthResponse>, tonic::Status> {
137            self.inner
138                .ready()
139                .await
140                .map_err(|e| {
141                    tonic::Status::unknown(
142                        format!("Service was not ready: {}", e.into()),
143                    )
144                })?;
145            let codec = tonic::codec::ProstCodec::default();
146            let path = http::uri::PathAndQuery::from_static(
147                "/serverpb.Server/GetHealth",
148            );
149            let mut req = request.into_request();
150            req.extensions_mut().insert(GrpcMethod::new("serverpb.Server", "GetHealth"));
151            self.inner.unary(req, path, codec).await
152        }
153    }
154}