aws-sdk-interconnect 1.1.0

AWS SDK for Interconnect
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub(crate) fn de_bandwidth_list(
    decoder: &mut ::aws_smithy_cbor::Decoder,
) -> ::std::result::Result<::std::vec::Vec<::std::string::String>, ::aws_smithy_cbor::decode::DeserializeError> {
    fn member(
        mut list: ::std::vec::Vec<::std::string::String>,
        decoder: &mut ::aws_smithy_cbor::Decoder,
    ) -> ::std::result::Result<::std::vec::Vec<::std::string::String>, ::aws_smithy_cbor::decode::DeserializeError> {
        let value = match decoder.datatype()? {
            ::aws_smithy_cbor::data::Type::Null => {
                return ::std::result::Result::Err(::aws_smithy_cbor::decode::DeserializeError::custom(
                    "dense list cannot contain null values",
                    decoder.position(),
                ))
            }
            _ => decoder.string()?,
        };
        list.push(value);
        Ok(list)
    }

    let mut list = ::std::vec::Vec::new();

    match decoder.list()? {
        None => loop {
            match decoder.datatype()? {
                ::aws_smithy_cbor::data::Type::Break => {
                    decoder.skip()?;
                    break;
                }
                _ => {
                    list = member(list, decoder)?;
                }
            };
        },
        Some(n) => {
            for _ in 0..n {
                list = member(list, decoder)?;
            }
        }
    };

    Ok(list)
}