stellar_xdr/generated/
liquidity_pool_entry.rs1#[allow(unused_imports, clippy::wildcard_imports)]
2use super::*;
3
4#[cfg_attr(feature = "alloc", derive(Default))]
30#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
31#[cfg_attr(feature = "serde", cfg_eval::cfg_eval)]
32#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33#[cfg_attr(
34 all(feature = "serde", feature = "alloc"),
35 serde_with::serde_as,
36 derive(serde::Serialize, serde::Deserialize),
37 serde(rename_all = "snake_case")
38)]
39#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
40pub struct LiquidityPoolEntry {
41 pub liquidity_pool_id: PoolId,
42 pub body: LiquidityPoolEntryBody,
43}
44
45impl ReadXdr for LiquidityPoolEntry {
46 #[cfg(feature = "std")]
47 fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> {
48 r.with_limited_depth(|r| {
49 Ok(Self {
50 liquidity_pool_id: PoolId::read_xdr(r)?,
51 body: LiquidityPoolEntryBody::read_xdr(r)?,
52 })
53 })
54 }
55}
56
57impl WriteXdr for LiquidityPoolEntry {
58 #[cfg(feature = "std")]
59 fn write_xdr<W: Write>(&self, w: &mut Limited<W>) -> Result<(), Error> {
60 w.with_limited_depth(|w| {
61 self.liquidity_pool_id.write_xdr(w)?;
62 self.body.write_xdr(w)?;
63 Ok(())
64 })
65 }
66}