stellar_xdr/generated/
account_entry.rs1#[allow(unused_imports, clippy::wildcard_imports)]
2use super::*;
3
4#[cfg_attr(feature = "alloc", derive(Default))]
38#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
39#[cfg_attr(feature = "serde", cfg_eval::cfg_eval)]
40#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41#[cfg_attr(
42 all(feature = "serde", feature = "alloc"),
43 serde_with::serde_as,
44 derive(serde::Serialize, serde::Deserialize),
45 serde(rename_all = "snake_case")
46)]
47#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
48pub struct AccountEntry {
49 pub account_id: AccountId,
50 #[cfg_attr(
51 all(feature = "serde", feature = "alloc"),
52 serde_as(as = "NumberOrString")
53 )]
54 pub balance: i64,
55 pub seq_num: SequenceNumber,
56 pub num_sub_entries: u32,
57 pub inflation_dest: Option<AccountId>,
58 pub flags: u32,
59 pub home_domain: String32,
60 pub thresholds: Thresholds,
61 pub signers: VecM<Signer, 20>,
62 pub ext: AccountEntryExt,
63}
64
65impl ReadXdr for AccountEntry {
66 #[cfg(feature = "std")]
67 fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> {
68 r.with_limited_depth(|r| {
69 Ok(Self {
70 account_id: AccountId::read_xdr(r)?,
71 balance: i64::read_xdr(r)?,
72 seq_num: SequenceNumber::read_xdr(r)?,
73 num_sub_entries: u32::read_xdr(r)?,
74 inflation_dest: Option::<AccountId>::read_xdr(r)?,
75 flags: u32::read_xdr(r)?,
76 home_domain: String32::read_xdr(r)?,
77 thresholds: Thresholds::read_xdr(r)?,
78 signers: VecM::<Signer, 20>::read_xdr(r)?,
79 ext: AccountEntryExt::read_xdr(r)?,
80 })
81 })
82 }
83}
84
85impl WriteXdr for AccountEntry {
86 #[cfg(feature = "std")]
87 fn write_xdr<W: Write>(&self, w: &mut Limited<W>) -> Result<(), Error> {
88 w.with_limited_depth(|w| {
89 self.account_id.write_xdr(w)?;
90 self.balance.write_xdr(w)?;
91 self.seq_num.write_xdr(w)?;
92 self.num_sub_entries.write_xdr(w)?;
93 self.inflation_dest.write_xdr(w)?;
94 self.flags.write_xdr(w)?;
95 self.home_domain.write_xdr(w)?;
96 self.thresholds.write_xdr(w)?;
97 self.signers.write_xdr(w)?;
98 self.ext.write_xdr(w)?;
99 Ok(())
100 })
101 }
102}