aws_sdk_s3/protocol_serde/
shape_encryption_configuration.rs
1pub fn ser_encryption_configuration(
3 input: &crate::types::EncryptionConfiguration,
4 writer: ::aws_smithy_xml::encode::ElWriter,
5) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
6 #[allow(unused_mut)]
7 let mut scope = writer.finish();
8 if let Some(var_1) = &input.replica_kms_key_id {
9 let mut inner_writer = scope.start_el("ReplicaKmsKeyID").finish();
10 inner_writer.data(var_1.as_str());
11 }
12 scope.finish();
13 Ok(())
14}
15
16#[allow(clippy::needless_question_mark)]
17pub fn de_encryption_configuration(
18 decoder: &mut ::aws_smithy_xml::decode::ScopedDecoder,
19) -> ::std::result::Result<crate::types::EncryptionConfiguration, ::aws_smithy_xml::decode::XmlDecodeError> {
20 #[allow(unused_mut)]
21 let mut builder = crate::types::EncryptionConfiguration::builder();
22 while let Some(mut tag) = decoder.next_tag() {
23 match tag.start_el() {
24 s if s.matches("ReplicaKmsKeyID") => {
25 let var_2 =
26 Some(
27 Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
28 ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
29 .into()
30 )
31 ?
32 )
33 ;
34 builder = builder.set_replica_kms_key_id(var_2);
35 }
36 ,
37 _ => {}
38 }
39 }
40 Ok(builder.build())
41}