stellar_xdr/generated/
set_options_op.rs1#[allow(unused_imports, clippy::wildcard_imports)]
2use super::*;
3
4#[cfg_attr(feature = "alloc", derive(Default))]
29#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
30#[cfg_attr(feature = "serde", cfg_eval::cfg_eval)]
31#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32#[cfg_attr(
33 all(feature = "serde", feature = "alloc"),
34 serde_with::serde_as,
35 derive(serde::Serialize, serde::Deserialize),
36 serde(rename_all = "snake_case")
37)]
38#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
39pub struct SetOptionsOp {
40 pub inflation_dest: Option<AccountId>,
41 pub clear_flags: Option<u32>,
42 pub set_flags: Option<u32>,
43 pub master_weight: Option<u32>,
44 pub low_threshold: Option<u32>,
45 pub med_threshold: Option<u32>,
46 pub high_threshold: Option<u32>,
47 pub home_domain: Option<String32>,
48 pub signer: Option<Signer>,
49}
50
51impl ReadXdr for SetOptionsOp {
52 #[cfg(feature = "std")]
53 fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> {
54 r.with_limited_depth(|r| {
55 Ok(Self {
56 inflation_dest: Option::<AccountId>::read_xdr(r)?,
57 clear_flags: Option::<u32>::read_xdr(r)?,
58 set_flags: Option::<u32>::read_xdr(r)?,
59 master_weight: Option::<u32>::read_xdr(r)?,
60 low_threshold: Option::<u32>::read_xdr(r)?,
61 med_threshold: Option::<u32>::read_xdr(r)?,
62 high_threshold: Option::<u32>::read_xdr(r)?,
63 home_domain: Option::<String32>::read_xdr(r)?,
64 signer: Option::<Signer>::read_xdr(r)?,
65 })
66 })
67 }
68}
69
70impl WriteXdr for SetOptionsOp {
71 #[cfg(feature = "std")]
72 fn write_xdr<W: Write>(&self, w: &mut Limited<W>) -> Result<(), Error> {
73 w.with_limited_depth(|w| {
74 self.inflation_dest.write_xdr(w)?;
75 self.clear_flags.write_xdr(w)?;
76 self.set_flags.write_xdr(w)?;
77 self.master_weight.write_xdr(w)?;
78 self.low_threshold.write_xdr(w)?;
79 self.med_threshold.write_xdr(w)?;
80 self.high_threshold.write_xdr(w)?;
81 self.home_domain.write_xdr(w)?;
82 self.signer.write_xdr(w)?;
83 Ok(())
84 })
85 }
86}