aws_sdk_s3/protocol_serde/
shape_stats.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(clippy::needless_question_mark)]
3pub fn de_stats(decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder) -> Result<crate::types::Stats, ::aws_smithy_xml::decode::XmlDecodeError> {
4    #[allow(unused_mut)]
5    let mut builder = crate::types::Stats::builder();
6    while let Some(mut tag) = decoder.next_tag() {
7        match tag.start_el() {
8            s if s.matches("BytesScanned") /* BytesScanned com.amazonaws.s3#Stats$BytesScanned */ =>  {
9                let var_1 =
10                    Some(
11                         {
12                            <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
13                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
14                            )
15                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.s3#BytesScanned`)"))
16                        }
17                        ?
18                    )
19                ;
20                builder = builder.set_bytes_scanned(var_1);
21            }
22            ,
23            s if s.matches("BytesProcessed") /* BytesProcessed com.amazonaws.s3#Stats$BytesProcessed */ =>  {
24                let var_2 =
25                    Some(
26                         {
27                            <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
28                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29                            )
30                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.s3#BytesProcessed`)"))
31                        }
32                        ?
33                    )
34                ;
35                builder = builder.set_bytes_processed(var_2);
36            }
37            ,
38            s if s.matches("BytesReturned") /* BytesReturned com.amazonaws.s3#Stats$BytesReturned */ =>  {
39                let var_3 =
40                    Some(
41                         {
42                            <i64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
43                                ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
44                            )
45                            .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (long: `com.amazonaws.s3#BytesReturned`)"))
46                        }
47                        ?
48                    )
49                ;
50                builder = builder.set_bytes_returned(var_3);
51            }
52            ,
53            _ => {}
54        }
55    }
56    Ok(builder.build())
57}