Skip to main content

thruput_node_rpc/
event_rpc.rs

1// -*-Rust-*-
2// Generated Code: DO NOT CHECK IN
3
4// Generated from xdrc commit: cb9cab8a8d69ace37c18d49b505f1e93ec802af8
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
29/// Each handler replies with anything that encodes like the reply type.
30/// Implementations can be plain `async fn`s returning a concrete reply type
31/// under `#[allow(refining_impl_trait)]`.
32#[allow(non_camel_case_types)]
33pub trait EventExecutor_EventExecutor1: Send + Sync {    
34    fn eventexecutor_null(&self) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<()>, ::thruput_rpc_api::ProgramError>> + Send;
35        // Called when executor opens a block - increments executor handle count
36
37    fn eventexecutor_open_block(&self, arg0 : BlockID) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<RPCError>, ::thruput_rpc_api::ProgramError>> + Send;
38        // Called when executor closes its handle to a block - decrements count
39
40    fn eventexecutor_close_block(&self, arg0 : BlockID) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<RPCError>, ::thruput_rpc_api::ProgramError>> + Send;
41        // Best-effort report that a transaction was excluded from the proposal:
42    // it failed nondeterministically during 2-phase commit, or the executor
43    // refused one of its contract attachments. The event server places this
44    // in a bounded best-effort mailbox for the indexer to pull; it touches no
45    // per-block state (this attempt will never commit, so it has no place in
46    // the commit pipeline). The executor sends fire-and-forget and ignores
47    // the result.
48
49    fn eventexecutor_report_tx_failure(&self, arg0 : TransactionHash, arg1 : TxFailureDiagnostic) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<RPCError>, ::thruput_rpc_api::ProgramError>> + Send;
50        // A transaction should not call this more than once
51    // We don't technically need the transaction ID here;
52    // however, this will help later with tracing RPC calls through the system,
53    // and helps in testing.
54    //
55    // The ProposedTransaction carries the full transaction body (signed_tx +
56    // nondeterministic data) so the event server can forward bodies to the
57    // indexer alongside the event log.  In proposal mode the executor assembles
58    // it from the SignedTransaction it executed plus the nondeterministic data
59    // it produced; in validation mode it is the ProposedTransaction it was given.
60
61    fn eventexecutor_emit_event(&self, arg0 : BlockID, arg1 : TransactionID, arg2 : TxEventLog, arg3 : ProposedTransaction) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<RPCError>, ::thruput_rpc_api::ProgramError>> + Send;
62}
63
64
65#[allow(non_camel_case_types)]
66pub struct EventExecutor_EventExecutor1_Dispatcher<__Handler> {
67  inner: Box<__Handler>,
68}
69
70impl<__Handler: EventExecutor_EventExecutor1> EventExecutor_EventExecutor1_Dispatcher<__Handler> {
71  pub fn new(inner: Box<__Handler>) -> Self {
72    Self { inner }
73  }
74}
75
76#[async_trait::async_trait]
77impl<__Handler: EventExecutor_EventExecutor1> ::thruput_rpc_api::RpcHandler for EventExecutor_EventExecutor1_Dispatcher<__Handler> {
78    fn prog_vers(&self) -> ::thruput_rpc_api::ProgVers {
79        ::thruput_rpc_api::ProgVers::new(0x8aa81224, 1)
80    }
81    async fn dispatch(&self, proc: u32, data: &[u8]) -> Result<Vec<u8>, ::thruput_rpc_api::RpcError> {
82        match proc {
83            // eventexecutor_null
84            0 => {
85                let args: () =
86                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
87                let res = self.inner.eventexecutor_null().await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
88                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
89            }
90            // eventexecutor_open_block
91            31 => {
92                let args: (BlockID, ) =
93                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
94                let res = self.inner.eventexecutor_open_block(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
95                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
96            }
97            // eventexecutor_close_block
98            32 => {
99                let args: (BlockID, ) =
100                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
101                let res = self.inner.eventexecutor_close_block(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
102                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
103            }
104            // eventexecutor_report_tx_failure
105            33 => {
106                let args: (TransactionHash, TxFailureDiagnostic, ) =
107                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
108                let res = self.inner.eventexecutor_report_tx_failure(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
109                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
110            }
111            // eventexecutor_emit_event
112            30 => {
113                let args: (BlockID, TransactionID, TxEventLog, ProposedTransaction, ) =
114                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
115                let res = self.inner.eventexecutor_emit_event(args.0, args.1, args.2, args.3).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
116                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
117            }
118            _ => Err(::thruput_rpc_api::RpcError::InvalidProcedure),
119        }
120    }
121}
122
123#[derive(Clone)]
124pub struct EventExecutor_EventExecutor1_Client {
125    handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>,
126}
127
128impl EventExecutor_EventExecutor1_Client {
129    pub fn new(handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>) -> Self {
130        Self { handle }
131    }
132
133    fn prog_vers() -> ::thruput_rpc_api::ProgVers {
134        ::thruput_rpc_api::ProgVers::new(0x8aa81224, 1)
135    }
136    pub async fn eventexecutor_null(&self) -> Result<(), ::thruput_rpc_api::RpcError> {
137         let mut call = self.handle.call_buf();
138         call.append_with(|buf| {
139             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
140             let r = xdrs::write_xdr(&(), &mut w);
141             *buf = w.into();
142             r
143         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
144         let mut out = ::core::option::Option::None;
145         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
146             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
147             Ok(())
148         };
149         // SAFETY: the call future is awaited right here, so it lives in
150         // this method's future along with `out` and `decode`. Once that
151         // is polled it is pinned, so neither can be freed without the
152         // call future being dropped first. Decoding never blocks.
153         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 0, call, &mut decode) }.await?;
154         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
155    }
156    pub async fn eventexecutor_open_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized)) -> Result<RPCError, ::thruput_rpc_api::RpcError> {
157         let mut call = self.handle.call_buf();
158         call.append_with(|buf| {
159             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
160             let r = xdrs::write_xdr(&(arg0), &mut w);
161             *buf = w.into();
162             r
163         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
164         let mut out = ::core::option::Option::None;
165         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
166             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
167             Ok(())
168         };
169         // SAFETY: the call future is awaited right here, so it lives in
170         // this method's future along with `out` and `decode`. Once that
171         // is polled it is pinned, so neither can be freed without the
172         // call future being dropped first. Decoding never blocks.
173         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 31, call, &mut decode) }.await?;
174         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
175    }
176    pub async fn eventexecutor_close_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized)) -> Result<RPCError, ::thruput_rpc_api::RpcError> {
177         let mut call = self.handle.call_buf();
178         call.append_with(|buf| {
179             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
180             let r = xdrs::write_xdr(&(arg0), &mut w);
181             *buf = w.into();
182             r
183         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
184         let mut out = ::core::option::Option::None;
185         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
186             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
187             Ok(())
188         };
189         // SAFETY: the call future is awaited right here, so it lives in
190         // this method's future along with `out` and `decode`. Once that
191         // is polled it is pinned, so neither can be freed without the
192         // call future being dropped first. Decoding never blocks.
193         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 32, call, &mut decode) }.await?;
194         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
195    }
196    pub async fn eventexecutor_report_tx_failure(&self, arg0 : &(impl xdrs::EncodesAs<TransactionHash> + ?Sized), arg1 : &(impl xdrs::EncodesAs<TxFailureDiagnostic> + ?Sized)) -> Result<RPCError, ::thruput_rpc_api::RpcError> {
197         let mut call = self.handle.call_buf();
198         call.append_with(|buf| {
199             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
200             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
201             *buf = w.into();
202             r
203         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
204         let mut out = ::core::option::Option::None;
205         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
206             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
207             Ok(())
208         };
209         // SAFETY: the call future is awaited right here, so it lives in
210         // this method's future along with `out` and `decode`. Once that
211         // is polled it is pinned, so neither can be freed without the
212         // call future being dropped first. Decoding never blocks.
213         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 33, call, &mut decode) }.await?;
214         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
215    }
216    pub async fn eventexecutor_emit_event(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<TransactionID> + ?Sized), arg2 : &(impl xdrs::EncodesAs<TxEventLog> + ?Sized), arg3 : &(impl xdrs::EncodesAs<ProposedTransaction> + ?Sized)) -> Result<RPCError, ::thruput_rpc_api::RpcError> {
217         let mut call = self.handle.call_buf();
218         call.append_with(|buf| {
219             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
220             let r = xdrs::write_xdr(&(arg0, arg1, arg2, arg3), &mut w);
221             *buf = w.into();
222             r
223         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
224         let mut out = ::core::option::Option::None;
225         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
226             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
227             Ok(())
228         };
229         // SAFETY: the call future is awaited right here, so it lives in
230         // this method's future along with `out` and `decode`. Once that
231         // is polled it is pinned, so neither can be freed without the
232         // call future being dropped first. Decoding never blocks.
233         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 30, call, &mut decode) }.await?;
234         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
235    }
236}
237
238impl From<::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>> for EventExecutor_EventExecutor1_Client {
239    fn from(handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>) -> Self {
240        Self::new(handle)
241    }
242}
243
244
245#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
246#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
247#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
248#[derive(schemars::JsonSchema)]
249#[repr(i32)]
250#[non_exhaustive]
251pub enum EventBlockResult {
252    // case kRPCNone:
253    //   SHA256Hash root_hash;
254    kRPCNone { root_hash: SHA256Hash } = RPCError::kRPCNone.0 as i32,
255    // default:
256    //   void;
257    #[xdr(default_variant)] Default { error: i32 },
258}
259
260
261/// Each handler replies with anything that encodes like the reply type.
262/// Implementations can be plain `async fn`s returning a concrete reply type
263/// under `#[allow(refining_impl_trait)]`.
264#[allow(non_camel_case_types)]
265pub trait EventSched_EventSched1: Send + Sync {    
266    fn eventsched_null(&self) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<()>, ::thruput_rpc_api::ProgramError>> + Send;
267    
268    fn eventsched_open_block(&self, arg0 : BlockID) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<RPCError>, ::thruput_rpc_api::ProgramError>> + Send;
269    
270    fn eventsched_close_block(&self, arg0 : BlockID, arg1 : BlockHeight) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<EventBlockResult>, ::thruput_rpc_api::ProgramError>> + Send;
271        // Called after finalization. Durably publishes the event/indexer record;
272    // the record becomes pullable as soon as this call succeeds, even if the
273    // local database commit running alongside it has not completed yet.
274
275    fn eventsched_commit_block(&self, arg0 : BlockID, arg1 : ConsensusValue) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<RPCError>, ::thruput_rpc_api::ProgramError>> + Send;
276    
277    fn eventsched_abandon_block(&self, arg0 : BlockID) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<RPCError>, ::thruput_rpc_api::ProgramError>> + Send;
278}
279
280
281#[allow(non_camel_case_types)]
282pub struct EventSched_EventSched1_Dispatcher<__Handler> {
283  inner: Box<__Handler>,
284}
285
286impl<__Handler: EventSched_EventSched1> EventSched_EventSched1_Dispatcher<__Handler> {
287  pub fn new(inner: Box<__Handler>) -> Self {
288    Self { inner }
289  }
290}
291
292#[async_trait::async_trait]
293impl<__Handler: EventSched_EventSched1> ::thruput_rpc_api::RpcHandler for EventSched_EventSched1_Dispatcher<__Handler> {
294    fn prog_vers(&self) -> ::thruput_rpc_api::ProgVers {
295        ::thruput_rpc_api::ProgVers::new(0x8aa81226, 1)
296    }
297    async fn dispatch(&self, proc: u32, data: &[u8]) -> Result<Vec<u8>, ::thruput_rpc_api::RpcError> {
298        match proc {
299            // eventsched_null
300            0 => {
301                let args: () =
302                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
303                let res = self.inner.eventsched_null().await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
304                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
305            }
306            // eventsched_open_block
307            10 => {
308                let args: (BlockID, ) =
309                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
310                let res = self.inner.eventsched_open_block(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
311                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
312            }
313            // eventsched_close_block
314            30 => {
315                let args: (BlockID, BlockHeight, ) =
316                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
317                let res = self.inner.eventsched_close_block(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
318                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
319            }
320            // eventsched_commit_block
321            31 => {
322                let args: (BlockID, ConsensusValue, ) =
323                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
324                let res = self.inner.eventsched_commit_block(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
325                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
326            }
327            // eventsched_abandon_block
328            40 => {
329                let args: (BlockID, ) =
330                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
331                let res = self.inner.eventsched_abandon_block(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
332                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
333            }
334            _ => Err(::thruput_rpc_api::RpcError::InvalidProcedure),
335        }
336    }
337}
338
339#[derive(Clone)]
340pub struct EventSched_EventSched1_Client {
341    handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>,
342}
343
344impl EventSched_EventSched1_Client {
345    pub fn new(handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>) -> Self {
346        Self { handle }
347    }
348
349    fn prog_vers() -> ::thruput_rpc_api::ProgVers {
350        ::thruput_rpc_api::ProgVers::new(0x8aa81226, 1)
351    }
352    pub async fn eventsched_null(&self) -> Result<(), ::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(&(), &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(), 0, call, &mut decode) }.await?;
370         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
371    }
372    pub async fn eventsched_open_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized)) -> Result<RPCError, ::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(), 10, call, &mut decode) }.await?;
390         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
391    }
392    pub async fn eventsched_close_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<BlockHeight> + ?Sized)) -> Result<EventBlockResult, ::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(&(arg0, arg1), &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(), 30, call, &mut decode) }.await?;
410         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
411    }
412    pub async fn eventsched_commit_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<ConsensusValue> + ?Sized)) -> Result<RPCError, ::thruput_rpc_api::RpcError> {
413         let mut call = self.handle.call_buf();
414         call.append_with(|buf| {
415             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
416             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
417             *buf = w.into();
418             r
419         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
420         let mut out = ::core::option::Option::None;
421         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
422             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
423             Ok(())
424         };
425         // SAFETY: the call future is awaited right here, so it lives in
426         // this method's future along with `out` and `decode`. Once that
427         // is polled it is pinned, so neither can be freed without the
428         // call future being dropped first. Decoding never blocks.
429         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 31, call, &mut decode) }.await?;
430         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
431    }
432    pub async fn eventsched_abandon_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized)) -> Result<RPCError, ::thruput_rpc_api::RpcError> {
433         let mut call = self.handle.call_buf();
434         call.append_with(|buf| {
435             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
436             let r = xdrs::write_xdr(&(arg0), &mut w);
437             *buf = w.into();
438             r
439         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
440         let mut out = ::core::option::Option::None;
441         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
442             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
443             Ok(())
444         };
445         // SAFETY: the call future is awaited right here, so it lives in
446         // this method's future along with `out` and `decode`. Once that
447         // is polled it is pinned, so neither can be freed without the
448         // call future being dropped first. Decoding never blocks.
449         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 40, call, &mut decode) }.await?;
450         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
451    }
452}
453
454impl From<::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>> for EventSched_EventSched1_Client {
455    fn from(handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>) -> Self {
456        Self::new(handle)
457    }
458}
459
460
461
462//
463// XDR internals below this point
464//
465
466impl EventBlockResult {
467    #[allow(clippy::match_single_binding)]
468    pub fn error(&self) -> RPCError {
469        match self {
470            EventBlockResult::Default{ error } => (*error).into(),
471
472            _ => (unsafe { *(self as *const Self as *const i32) }).into(),
473        }
474    }
475}
476
477