Skip to main content

stellar_xdr/generated/
signed_time_sliced_survey_start_collecting_message.rs

1#[allow(unused_imports, clippy::wildcard_imports)]
2use super::*;
3
4/// SignedTimeSlicedSurveyStartCollectingMessage is an XDR Struct defined as:
5///
6/// ```text
7/// struct SignedTimeSlicedSurveyStartCollectingMessage
8/// {
9///     Signature signature;
10///     TimeSlicedSurveyStartCollectingMessage startCollecting;
11/// };
12/// ```
13///
14#[cfg_attr(feature = "alloc", derive(Default))]
15#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
16#[cfg_attr(feature = "serde", cfg_eval::cfg_eval)]
17#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18#[cfg_attr(
19    all(feature = "serde", feature = "alloc"),
20    serde_with::serde_as,
21    derive(serde::Serialize, serde::Deserialize),
22    serde(rename_all = "snake_case")
23)]
24#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
25pub struct SignedTimeSlicedSurveyStartCollectingMessage {
26    pub signature: Signature,
27    pub start_collecting: TimeSlicedSurveyStartCollectingMessage,
28}
29
30impl ReadXdr for SignedTimeSlicedSurveyStartCollectingMessage {
31    #[cfg(feature = "std")]
32    fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> {
33        r.with_limited_depth(|r| {
34            Ok(Self {
35                signature: Signature::read_xdr(r)?,
36                start_collecting: TimeSlicedSurveyStartCollectingMessage::read_xdr(r)?,
37            })
38        })
39    }
40}
41
42impl WriteXdr for SignedTimeSlicedSurveyStartCollectingMessage {
43    #[cfg(feature = "std")]
44    fn write_xdr<W: Write>(&self, w: &mut Limited<W>) -> Result<(), Error> {
45        w.with_limited_depth(|w| {
46            self.signature.write_xdr(w)?;
47            self.start_collecting.write_xdr(w)?;
48            Ok(())
49        })
50    }
51}