stellar_xdr/generated/
sc_spec_function_v0.rs1#[allow(unused_imports, clippy::wildcard_imports)]
2use super::*;
3
4#[cfg_attr(feature = "alloc", derive(Default))]
17#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
18#[cfg_attr(feature = "serde", cfg_eval::cfg_eval)]
19#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20#[cfg_attr(
21 all(feature = "serde", feature = "alloc"),
22 serde_with::serde_as,
23 derive(serde::Serialize, serde::Deserialize),
24 serde(rename_all = "snake_case")
25)]
26#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
27pub struct ScSpecFunctionV0 {
28 pub doc: StringM<1024>,
29 pub name: ScSymbol,
30 pub inputs: VecM<ScSpecFunctionInputV0>,
31 pub outputs: VecM<ScSpecTypeDef, 1>,
32}
33
34impl ReadXdr for ScSpecFunctionV0 {
35 #[cfg(feature = "std")]
36 fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> {
37 r.with_limited_depth(|r| {
38 Ok(Self {
39 doc: StringM::<1024>::read_xdr(r)?,
40 name: ScSymbol::read_xdr(r)?,
41 inputs: VecM::<ScSpecFunctionInputV0>::read_xdr(r)?,
42 outputs: VecM::<ScSpecTypeDef, 1>::read_xdr(r)?,
43 })
44 })
45 }
46}
47
48impl WriteXdr for ScSpecFunctionV0 {
49 #[cfg(feature = "std")]
50 fn write_xdr<W: Write>(&self, w: &mut Limited<W>) -> Result<(), Error> {
51 w.with_limited_depth(|w| {
52 self.doc.write_xdr(w)?;
53 self.name.write_xdr(w)?;
54 self.inputs.write_xdr(w)?;
55 self.outputs.write_xdr(w)?;
56 Ok(())
57 })
58 }
59}