thruput_node_types/
parallel.rs1#![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#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
32#[derive(schemars::JsonSchema)]
33#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
34#[repr(C)]
35pub struct ParallelBatch {
36 pub segment_tokens: VecM<u32>,
37 pub segment_bytes: VecM<u32>,
38 pub xdr: BytesM,
39}
40
41#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
43#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
44#[derive(schemars::JsonSchema)]
45#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
46#[repr(transparent)]
47#[cfg_attr(feature = "serde", serde(transparent))]
48pub struct ParallelSignedTransactionBatch {
49 inner: ParallelBatch,
50}
51impl From<ParallelBatch> for ParallelSignedTransactionBatch {
52 fn from(_inner: ParallelBatch) -> Self {
53 Self { inner: _inner }
54 }
55}
56impl ParallelSignedTransactionBatch {
57 pub fn into_inner(self) -> ParallelBatch {
58 self.inner
59 }
60 pub const fn new(_inner: ParallelBatch) -> Self {
61 Self { inner: _inner }
62 }
63}
64
65impl Deref for ParallelSignedTransactionBatch {
66 type Target = ParallelBatch;
67
68 fn deref(&self) -> &Self::Target {
69 &self.inner
70 }
71}
72impl DerefMut for ParallelSignedTransactionBatch {
73 fn deref_mut(&mut self) -> &mut Self::Target {
74 &mut self.inner
75 }
76}
77
78#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
80#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
81#[derive(schemars::JsonSchema)]
82#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
83#[repr(transparent)]
84#[cfg_attr(feature = "serde", serde(transparent))]
85pub struct ParallelSignedTransactionHashBatch {
86 inner: ParallelBatch,
87}
88impl From<ParallelBatch> for ParallelSignedTransactionHashBatch {
89 fn from(_inner: ParallelBatch) -> Self {
90 Self { inner: _inner }
91 }
92}
93impl ParallelSignedTransactionHashBatch {
94 pub fn into_inner(self) -> ParallelBatch {
95 self.inner
96 }
97 pub const fn new(_inner: ParallelBatch) -> Self {
98 Self { inner: _inner }
99 }
100}
101
102impl Deref for ParallelSignedTransactionHashBatch {
103 type Target = ParallelBatch;
104
105 fn deref(&self) -> &Self::Target {
106 &self.inner
107 }
108}
109impl DerefMut for ParallelSignedTransactionHashBatch {
110 fn deref_mut(&mut self) -> &mut Self::Target {
111 &mut self.inner
112 }
113}
114
115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
117#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
118#[derive(schemars::JsonSchema)]
119#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
120#[repr(transparent)]
121#[cfg_attr(feature = "serde", serde(transparent))]
122pub struct ParallelNondeterministicProposalDataBatch {
123 inner: ParallelBatch,
124}
125impl From<ParallelBatch> for ParallelNondeterministicProposalDataBatch {
126 fn from(_inner: ParallelBatch) -> Self {
127 Self { inner: _inner }
128 }
129}
130impl ParallelNondeterministicProposalDataBatch {
131 pub fn into_inner(self) -> ParallelBatch {
132 self.inner
133 }
134 pub const fn new(_inner: ParallelBatch) -> Self {
135 Self { inner: _inner }
136 }
137}
138
139impl Deref for ParallelNondeterministicProposalDataBatch {
140 type Target = ParallelBatch;
141
142 fn deref(&self) -> &Self::Target {
143 &self.inner
144 }
145}
146impl DerefMut for ParallelNondeterministicProposalDataBatch {
147 fn deref_mut(&mut self) -> &mut Self::Target {
148 &mut self.inner
149 }
150}
151
152
153