Skip to main content

thruput_node_rpc/
exec_sched.rs

1// -*-Rust-*-
2// Generated Code: DO NOT CHECK IN
3
4// Generated from xdrc commit: 6ab835b07c234abb4b0b50b61d687904727a4f32
5
6#![allow(non_camel_case_types)]
7#![allow(non_snake_case)]
8#![allow(non_upper_case_globals)]
9#![allow(unused_imports)]
10#![allow(dead_code)]
11#![allow(unused_variables)]
12#![allow(clippy::unnecessary_cast)]
13
14use crate::*;
15use core::option::Option;
16use core::ops::{Deref, DerefMut};
17
18#[cfg(feature = "std")]
19use std::io::{Read, Write};
20use xdrs::*;
21
22
23#[cfg(feature = "serde")]
24use ::serde::{{Serialize, Deserialize}};
25
26
27
28// clang-format on
29
30#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
31#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
33#[derive(schemars::JsonSchema)]
34#[repr(i32)]
35#[non_exhaustive]
36pub enum ExecProposeResult {
37    // case ExecResultOK:
38    // case ExecResultTxDeterministicError:
39    // case ExecResultTxRootFrameReverted:
40    //   NondeterministicProposalData proposal_data;
41    ExecResultOK { proposal_data: NondeterministicProposalData } = ExecResult::ExecResultOK.0 as i32,
42    ExecResultTxDeterministicError { proposal_data: NondeterministicProposalData } = ExecResult::ExecResultTxDeterministicError.0 as i32,
43    ExecResultTxRootFrameReverted { proposal_data: NondeterministicProposalData } = ExecResult::ExecResultTxRootFrameReverted.0 as i32,
44    // default:
45    //   void;
46    #[xdr(default_variant)] Default { result: i32 },
47}
48
49pub type ExecProposeBatchResult = VecM::<ExecProposeResult>;
50
51pub type ExecValidateBatchResult = VecM::<ExecResult>;
52
53
54/// Each handler replies with anything that encodes like the reply type.
55/// Implementations can be plain `async fn`s returning a concrete reply type
56/// under `#[allow(refining_impl_trait)]`.
57#[allow(non_camel_case_types)]
58pub trait ExecutorSched_ExecutorSched1: Send + Sync {    
59    fn executorsched_null(&self) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<()>, ::thruput_rpc_api::ProgramError>> + Send;
60    
61    fn executorsched_ready(&self) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<ExecResult>, ::thruput_rpc_api::ProgramError>> + Send;
62    
63    fn executorsched_propose_transaction(&self, arg0 : BlockID, arg1 : SignedTransaction) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<ExecProposeResult>, ::thruput_rpc_api::ProgramError>> + Send;
64    
65    fn executorsched_validate_transaction(&self, arg0 : BlockID, arg1 : ProposedTransaction) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<ExecResult>, ::thruput_rpc_api::ProgramError>> + Send;
66    
67    fn executorsched_propose_batch(&self, arg0 : BlockID, arg1 : SignedTransactionBatch) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<ExecProposeBatchResult>, ::thruput_rpc_api::ProgramError>> + Send;
68    
69    fn executorsched_validate_batch(&self, arg0 : BlockID, arg1 : ProposedTransactionBatch) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<ExecValidateBatchResult>, ::thruput_rpc_api::ProgramError>> + Send;
70        // Executor can be in one of three states: None, Proposing, Validating
71    // open_xyz_block() methods set the executor state, or return an error
72    // if executor has already opened a block.
73    // finish_block() blocks until all running executor threads are finished,
74    // and stops the executor from accepting new transactions.
75    //
76    // Both open_xyz_block() methods take the same BlockExecutionContext, so
77    // the executor sees an identical view of the block whether it is
78    // proposing or validating, and everything a contract can observe about
79    // the current block (its height, and the GetBlockTimepoint syscall)
80    // comes from one place instead of being inferred from the parent tip.
81    //
82    // The scheduler builds the context from whichever side it is on:
83    //   - proposing:  from the coordinator's ProposalContext, passed to
84    //                 schedulercoord_propose_block.
85    //   - validating: from the ProposalHeader of the proposal under
86    //                 validation.
87    //
88    // A validator MUST take these values from the proposal it is validating
89    // and never regenerate them locally: the proposer's values are the ones
90    // its execution committed to, so any divergence here diverges execution
91    // and splits consensus.
92
93    fn executorsched_open_proposal_block(&self, arg0 : BlockID, arg1 : BlockExecutionContext) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<ExecResult>, ::thruput_rpc_api::ProgramError>> + Send;
94    
95    fn executorsched_open_validation_block(&self, arg0 : BlockID, arg1 : BlockExecutionContext) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<ExecResult>, ::thruput_rpc_api::ProgramError>> + Send;
96    
97    fn executorsched_finish_block(&self, arg0 : BlockID) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<ExecResult>, ::thruput_rpc_api::ProgramError>> + Send;
98        // Scheduler should call this to shutdown the executor.
99    // Shutdown will not occur until all pending transactions complete.
100    // No new transactions or blocks can be opened after shutdown.
101
102    fn executorsched_shutdown(&self) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<()>, ::thruput_rpc_api::ProgramError>> + Send;
103}
104
105
106#[allow(non_camel_case_types)]
107pub struct ExecutorSched_ExecutorSched1_Dispatcher<__Handler> {
108  inner: Box<__Handler>,
109}
110
111impl<__Handler: ExecutorSched_ExecutorSched1> ExecutorSched_ExecutorSched1_Dispatcher<__Handler> {
112  pub fn new(inner: Box<__Handler>) -> Self {
113    Self { inner }
114  }
115}
116
117#[async_trait::async_trait]
118impl<__Handler: ExecutorSched_ExecutorSched1> ::thruput_rpc_api::RpcHandler for ExecutorSched_ExecutorSched1_Dispatcher<__Handler> {
119    fn prog_vers(&self) -> ::thruput_rpc_api::ProgVers {
120        ::thruput_rpc_api::ProgVers::new(0x7ee79999, 1)
121    }
122    async fn dispatch(&self, proc: u32, data: &[u8]) -> Result<Vec<u8>, ::thruput_rpc_api::RpcError> {
123        match proc {
124            // executorsched_null
125            0 => {
126                let args: () =
127                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
128                let res = self.inner.executorsched_null().await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
129                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
130            }
131            // executorsched_ready
132            1 => {
133                let args: () =
134                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
135                let res = self.inner.executorsched_ready().await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
136                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
137            }
138            // executorsched_propose_transaction
139            10 => {
140                let args: (BlockID, SignedTransaction, ) =
141                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
142                let res = self.inner.executorsched_propose_transaction(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
143                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
144            }
145            // executorsched_validate_transaction
146            20 => {
147                let args: (BlockID, ProposedTransaction, ) =
148                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
149                let res = self.inner.executorsched_validate_transaction(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
150                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
151            }
152            // executorsched_propose_batch
153            11 => {
154                let args: (BlockID, SignedTransactionBatch, ) =
155                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
156                let res = self.inner.executorsched_propose_batch(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
157                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
158            }
159            // executorsched_validate_batch
160            21 => {
161                let args: (BlockID, ProposedTransactionBatch, ) =
162                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
163                let res = self.inner.executorsched_validate_batch(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
164                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
165            }
166            // executorsched_open_proposal_block
167            30 => {
168                let args: (BlockID, BlockExecutionContext, ) =
169                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
170                let res = self.inner.executorsched_open_proposal_block(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
171                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
172            }
173            // executorsched_open_validation_block
174            40 => {
175                let args: (BlockID, BlockExecutionContext, ) =
176                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
177                let res = self.inner.executorsched_open_validation_block(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
178                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
179            }
180            // executorsched_finish_block
181            50 => {
182                let args: (BlockID, ) =
183                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
184                let res = self.inner.executorsched_finish_block(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
185                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
186            }
187            // executorsched_shutdown
188            60 => {
189                let args: () =
190                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
191                let res = self.inner.executorsched_shutdown().await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
192                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
193            }
194            _ => Err(::thruput_rpc_api::RpcError::InvalidProcedure),
195        }
196    }
197}
198
199#[derive(Clone)]
200pub struct ExecutorSched_ExecutorSched1_Client {
201    handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>,
202}
203
204impl ExecutorSched_ExecutorSched1_Client {
205    pub fn new(handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>) -> Self {
206        Self { handle }
207    }
208
209    fn prog_vers() -> ::thruput_rpc_api::ProgVers {
210        ::thruput_rpc_api::ProgVers::new(0x7ee79999, 1)
211    }
212    pub async fn executorsched_null(&self) -> Result<(), ::thruput_rpc_api::RpcError> {
213         let mut call = self.handle.call_buf();
214         call.append_with(|buf| {
215             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
216             let r = xdrs::write_xdr(&(), &mut w);
217             *buf = w.into();
218             r
219         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
220         let mut out = ::core::option::Option::None;
221         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
222             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
223             Ok(())
224         };
225         // SAFETY: the call future is awaited right here, so it lives in
226         // this method's future along with `out` and `decode`. Once that
227         // is polled it is pinned, so neither can be freed without the
228         // call future being dropped first. Decoding never blocks.
229         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 0, call, &mut decode) }.await?;
230         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
231    }
232    pub async fn executorsched_ready(&self) -> Result<ExecResult, ::thruput_rpc_api::RpcError> {
233         let mut call = self.handle.call_buf();
234         call.append_with(|buf| {
235             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
236             let r = xdrs::write_xdr(&(), &mut w);
237             *buf = w.into();
238             r
239         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
240         let mut out = ::core::option::Option::None;
241         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
242             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
243             Ok(())
244         };
245         // SAFETY: the call future is awaited right here, so it lives in
246         // this method's future along with `out` and `decode`. Once that
247         // is polled it is pinned, so neither can be freed without the
248         // call future being dropped first. Decoding never blocks.
249         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 1, call, &mut decode) }.await?;
250         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
251    }
252    pub async fn executorsched_propose_transaction(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<SignedTransaction> + ?Sized)) -> Result<ExecProposeResult, ::thruput_rpc_api::RpcError> {
253         let mut call = self.handle.call_buf();
254         call.append_with(|buf| {
255             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
256             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
257             *buf = w.into();
258             r
259         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
260         let mut out = ::core::option::Option::None;
261         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
262             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
263             Ok(())
264         };
265         // SAFETY: the call future is awaited right here, so it lives in
266         // this method's future along with `out` and `decode`. Once that
267         // is polled it is pinned, so neither can be freed without the
268         // call future being dropped first. Decoding never blocks.
269         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 10, call, &mut decode) }.await?;
270         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
271    }
272    pub async fn executorsched_validate_transaction(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<ProposedTransaction> + ?Sized)) -> Result<ExecResult, ::thruput_rpc_api::RpcError> {
273         let mut call = self.handle.call_buf();
274         call.append_with(|buf| {
275             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
276             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
277             *buf = w.into();
278             r
279         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
280         let mut out = ::core::option::Option::None;
281         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
282             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
283             Ok(())
284         };
285         // SAFETY: the call future is awaited right here, so it lives in
286         // this method's future along with `out` and `decode`. Once that
287         // is polled it is pinned, so neither can be freed without the
288         // call future being dropped first. Decoding never blocks.
289         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 20, call, &mut decode) }.await?;
290         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
291    }
292    pub async fn executorsched_propose_batch(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<SignedTransactionBatch> + ?Sized)) -> Result<ExecProposeBatchResult, ::thruput_rpc_api::RpcError> {
293         let mut call = self.handle.call_buf();
294         call.append_with(|buf| {
295             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
296             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
297             *buf = w.into();
298             r
299         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
300         let mut out = ::core::option::Option::None;
301         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
302             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
303             Ok(())
304         };
305         // SAFETY: the call future is awaited right here, so it lives in
306         // this method's future along with `out` and `decode`. Once that
307         // is polled it is pinned, so neither can be freed without the
308         // call future being dropped first. Decoding never blocks.
309         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 11, call, &mut decode) }.await?;
310         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
311    }
312    pub async fn executorsched_validate_batch(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<ProposedTransactionBatch> + ?Sized)) -> Result<ExecValidateBatchResult, ::thruput_rpc_api::RpcError> {
313         let mut call = self.handle.call_buf();
314         call.append_with(|buf| {
315             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
316             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
317             *buf = w.into();
318             r
319         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
320         let mut out = ::core::option::Option::None;
321         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
322             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
323             Ok(())
324         };
325         // SAFETY: the call future is awaited right here, so it lives in
326         // this method's future along with `out` and `decode`. Once that
327         // is polled it is pinned, so neither can be freed without the
328         // call future being dropped first. Decoding never blocks.
329         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 21, call, &mut decode) }.await?;
330         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
331    }
332    pub async fn executorsched_open_proposal_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<BlockExecutionContext> + ?Sized)) -> Result<ExecResult, ::thruput_rpc_api::RpcError> {
333         let mut call = self.handle.call_buf();
334         call.append_with(|buf| {
335             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
336             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
337             *buf = w.into();
338             r
339         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
340         let mut out = ::core::option::Option::None;
341         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
342             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
343             Ok(())
344         };
345         // SAFETY: the call future is awaited right here, so it lives in
346         // this method's future along with `out` and `decode`. Once that
347         // is polled it is pinned, so neither can be freed without the
348         // call future being dropped first. Decoding never blocks.
349         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 30, call, &mut decode) }.await?;
350         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
351    }
352    pub async fn executorsched_open_validation_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<BlockExecutionContext> + ?Sized)) -> Result<ExecResult, ::thruput_rpc_api::RpcError> {
353         let mut call = self.handle.call_buf();
354         call.append_with(|buf| {
355             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
356             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
357             *buf = w.into();
358             r
359         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
360         let mut out = ::core::option::Option::None;
361         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
362             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
363             Ok(())
364         };
365         // SAFETY: the call future is awaited right here, so it lives in
366         // this method's future along with `out` and `decode`. Once that
367         // is polled it is pinned, so neither can be freed without the
368         // call future being dropped first. Decoding never blocks.
369         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 40, call, &mut decode) }.await?;
370         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
371    }
372    pub async fn executorsched_finish_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized)) -> Result<ExecResult, ::thruput_rpc_api::RpcError> {
373         let mut call = self.handle.call_buf();
374         call.append_with(|buf| {
375             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
376             let r = xdrs::write_xdr(&(arg0), &mut w);
377             *buf = w.into();
378             r
379         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
380         let mut out = ::core::option::Option::None;
381         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
382             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
383             Ok(())
384         };
385         // SAFETY: the call future is awaited right here, so it lives in
386         // this method's future along with `out` and `decode`. Once that
387         // is polled it is pinned, so neither can be freed without the
388         // call future being dropped first. Decoding never blocks.
389         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 50, call, &mut decode) }.await?;
390         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
391    }
392    pub async fn executorsched_shutdown(&self) -> Result<(), ::thruput_rpc_api::RpcError> {
393         let mut call = self.handle.call_buf();
394         call.append_with(|buf| {
395             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
396             let r = xdrs::write_xdr(&(), &mut w);
397             *buf = w.into();
398             r
399         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
400         let mut out = ::core::option::Option::None;
401         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
402             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
403             Ok(())
404         };
405         // SAFETY: the call future is awaited right here, so it lives in
406         // this method's future along with `out` and `decode`. Once that
407         // is polled it is pinned, so neither can be freed without the
408         // call future being dropped first. Decoding never blocks.
409         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 60, call, &mut decode) }.await?;
410         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
411    }
412}
413
414impl From<::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>> for ExecutorSched_ExecutorSched1_Client {
415    fn from(handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>) -> Self {
416        Self::new(handle)
417    }
418}
419
420
421
422//
423// XDR internals below this point
424//
425
426impl ExecProposeResult {
427    #[allow(clippy::match_single_binding)]
428    pub fn result(&self) -> ExecResult {
429        match self {
430            ExecProposeResult::Default{ result } => (*result).into(),
431
432            _ => (unsafe { *(self as *const Self as *const i32) }).into(),
433        }
434    }
435}
436
437