Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_blob_list.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:616 */
    2      3   
pub(crate) fn de_blob_list(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<::aws_smithy_types::Blob>,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn member(
    9     10   
        mut list: ::std::vec::Vec<::aws_smithy_types::Blob>,
   10     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   11     12   
    ) -> ::std::result::Result<

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_boolean_list.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:616 */
    2      3   
pub(crate) fn de_boolean_list(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<bool>, ::aws_smithy_cbor::decode::DeserializeError> {
    5      6   
    fn member(
    6      7   
        mut list: ::std::vec::Vec<bool>,
    7      8   
        decoder: &mut ::aws_smithy_cbor::Decoder,
    8      9   
    ) -> ::std::result::Result<::std::vec::Vec<bool>, ::aws_smithy_cbor::decode::DeserializeError>
    9     10   
    {
   10     11   
        let value = match decoder.datatype()? {
   11     12   
            ::aws_smithy_cbor::data::Type::Null => {

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_client_optional_defaults.rs

@@ -1,1 +54,61 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:692 */
    2      3   
pub(crate) fn de_client_optional_defaults(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    crate::model::ClientOptionalDefaults,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
           9  +
    /* CborParserGenerator.kt:700 */
    8     10   
    #[allow(clippy::match_single_binding)]
    9     11   
    fn pair(
   10     12   
        mut builder: crate::model::client_optional_defaults::Builder,
   11     13   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   12     14   
    ) -> ::std::result::Result<
   13     15   
        crate::model::client_optional_defaults::Builder,
   14     16   
        ::aws_smithy_cbor::decode::DeserializeError,
   15     17   
    > {
   16     18   
        builder = match decoder.str()?.as_ref() {
   17     19   
            "member" => {
   18     20   
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
   19     21   
                    Ok(builder.set_member(decoder.integer()?))
   20     22   
                })?
   21     23   
            }
   22     24   
            _ => {
   23     25   
                decoder.skip()?;
   24     26   
                builder
   25     27   
            }
   26     28   
        };
   27     29   
        Ok(builder)
   28     30   
    }
   29     31   
   30     32   
    let mut builder = crate::model::client_optional_defaults::Builder::default();
   31     33   
   32     34   
    match decoder.map()? {
   33     35   
        None => loop {
   34     36   
            match decoder.datatype()? {
   35     37   
                ::aws_smithy_cbor::data::Type::Break => {
   36     38   
                    decoder.skip()?;
   37     39   
                    break;
   38     40   
                }
   39     41   
                _ => {
   40     42   
                    builder = pair(builder, decoder)?;
   41     43   
                }
   42     44   
            };
   43     45   
        },
   44     46   
        Some(n) => {
   45     47   
            for _ in 0..n {
   46     48   
                builder = pair(builder, decoder)?;
   47     49   
            }
   48     50   
        }
   49     51   
    };
          52  +
    /* CborParserGenerator.kt:726 */
   50     53   
    #[allow(clippy::needless_question_mark)]
          54  +
    /* CborParserGenerator.kt:727 */
   51     55   
    {
          56  +
        /* CborParserGenerator.kt:728 */
   52     57   
        return Ok(builder.build());
          58  +
        /* CborParserGenerator.kt:727 */
   53     59   
    }
          60  +
    /* CborParserGenerator.kt:692 */
   54     61   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_complex_error.rs

@@ -1,1 +35,56 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_complex_error_error(
    3      4   
    value: &crate::error::ComplexError,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<u8>,
    6      7   
    ::aws_smithy_types::error::operation::SerializationError,
    7      8   
> {
           9  +
    /* CborSerializerGenerator.kt:233 */
    8     10   
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
          11  +
    /* CborSerializerGenerator.kt:235 */
    9     12   
    {
          13  +
        /* CborSerializerGenerator.kt:236 */
   10     14   
        let encoder = &mut encoder;
          15  +
        /* CborSerializerGenerator.kt:403 */
   11     16   
        crate::protocol_serde::shape_complex_error::ser_complex_error(encoder, value)?;
          17  +
        /* CborSerializerGenerator.kt:235 */
   12     18   
    }
          19  +
    /* CborSerializerGenerator.kt:242 */
   13     20   
    ::std::result::Result::Ok(encoder.into_writer())
          21  +
    /* CborSerializerGenerator.kt:228 */
   14     22   
}
   15     23   
          24  +
/* CborSerializerGenerator.kt:369 */
   16     25   
pub fn ser_complex_error(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::error::ComplexError,
   19     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* CborSerializerGenerator.kt:377 */
   20     30   
    encoder.begin_map();
          31  +
    /* AddTypeFieldToServerErrorsCborCustomization.kt:47 */
   21     32   
    encoder
   22     33   
        .str("__type")
   23     34   
        .str("smithy.protocoltests.rpcv2Cbor#ComplexError");
          35  +
    /* CborSerializerGenerator.kt:414 */
   24     36   
    if let Some(var_1) = &input.top_level {
          37  +
        /* CborSerializerGenerator.kt:462 */
   25     38   
        encoder.str("TopLevel").str(var_1.as_str());
          39  +
        /* CborSerializerGenerator.kt:414 */
   26     40   
    }
          41  +
    /* CborSerializerGenerator.kt:414 */
   27     42   
    if let Some(var_2) = &input.nested {
          43  +
        /* CborSerializerGenerator.kt:486 */
   28     44   
        encoder.str("Nested");
          45  +
        /* CborSerializerGenerator.kt:403 */
   29     46   
        crate::protocol_serde::shape_complex_nested_error_data::ser_complex_nested_error_data(
   30     47   
            encoder, var_2,
   31     48   
        )?;
          49  +
        /* CborSerializerGenerator.kt:414 */
   32     50   
    }
          51  +
    /* CborSerializerGenerator.kt:393 */
   33     52   
    encoder.end();
          53  +
    /* CborSerializerGenerator.kt:394 */
   34     54   
    Ok(())
          55  +
    /* CborSerializerGenerator.kt:369 */
   35     56   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_complex_nested_error_data.rs

@@ -1,1 +12,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:369 */
    2      3   
pub fn ser_complex_nested_error_data(
    3      4   
    encoder: &mut ::aws_smithy_cbor::Encoder,
    4      5   
    #[allow(unused)] input: &crate::model::ComplexNestedErrorData,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* CborSerializerGenerator.kt:377 */
    6      8   
    encoder.begin_map();
           9  +
    /* CborSerializerGenerator.kt:414 */
    7     10   
    if let Some(var_1) = &input.foo {
          11  +
        /* CborSerializerGenerator.kt:462 */
    8     12   
        encoder.str("Foo").str(var_1.as_str());
          13  +
        /* CborSerializerGenerator.kt:414 */
    9     14   
    }
          15  +
    /* CborSerializerGenerator.kt:393 */
   10     16   
    encoder.end();
          17  +
    /* CborSerializerGenerator.kt:394 */
   11     18   
    Ok(())
          19  +
    /* CborSerializerGenerator.kt:369 */
   12     20   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_defaults.rs

@@ -1,1 +37,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:692 */
    2      3   
pub(crate) fn de_defaults(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    crate::model::defaults::Builder,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
           9  +
    /* CborParserGenerator.kt:700 */
    8     10   
    #[allow(clippy::match_single_binding)]
    9     11   
    fn pair(
   10     12   
        mut builder: crate::model::defaults::Builder,
   11     13   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   12     14   
    ) -> ::std::result::Result<
   13     15   
        crate::model::defaults::Builder,
   14     16   
        ::aws_smithy_cbor::decode::DeserializeError,
   15     17   
    > {
   16     18   
        builder = match decoder.str()?.as_ref() {
   17     19   
            "defaultString" => {
@@ -136,138 +167,171 @@
  156    158   
                    builder = pair(builder, decoder)?;
  157    159   
                }
  158    160   
            };
  159    161   
        },
  160    162   
        Some(n) => {
  161    163   
            for _ in 0..n {
  162    164   
                builder = pair(builder, decoder)?;
  163    165   
            }
  164    166   
        }
  165    167   
    };
         168  +
    /* CborParserGenerator.kt:716 */
  166    169   
    Ok(builder)
         170  +
    /* CborParserGenerator.kt:692 */
  167    171   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_dense_boolean_map.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:659 */
    2      3   
pub(crate) fn de_dense_boolean_map(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::collections::HashMap<::std::string::String, bool>,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn pair(
    9     10   
        mut map: ::std::collections::HashMap<::std::string::String, bool>,
   10     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   11     12   
    ) -> ::std::result::Result<

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_dense_number_map.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:659 */
    2      3   
pub(crate) fn de_dense_number_map(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::collections::HashMap<::std::string::String, i32>,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn pair(
    9     10   
        mut map: ::std::collections::HashMap<::std::string::String, i32>,
   10     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   11     12   
    ) -> ::std::result::Result<

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_dense_set_map.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:659 */
    2      3   
pub(crate) fn de_dense_set_map(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    crate::unconstrained::dense_set_map_unconstrained::DenseSetMapUnconstrained,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn pair(
    9     10   
        mut map: crate::unconstrained::dense_set_map_unconstrained::DenseSetMapUnconstrained,
   10     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   11     12   
    ) -> ::std::result::Result<

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_dense_string_map.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:659 */
    2      3   
pub(crate) fn de_dense_string_map(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::collections::HashMap<::std::string::String, ::std::string::String>,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn pair(
    9     10   
        mut map: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
   10     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   11     12   
    ) -> ::std::result::Result<

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_dense_struct_map.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:659 */
    2      3   
pub(crate) fn de_dense_struct_map(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::collections::HashMap<::std::string::String, crate::model::GreetingStruct>,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn pair(
    9     10   
        mut map: ::std::collections::HashMap<::std::string::String, crate::model::GreetingStruct>,
   10     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   11     12   
    ) -> ::std::result::Result<

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_empty_input_output.rs

@@ -1,1 +60,84 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_empty_input_output_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::EmptyInputOutputInput,
    7      9   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::empty_input_output_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_empty_input_output_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::EmptyInputOutputOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/cbor",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   41     58   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   42     59   
            builder,
   43     60   
            ::http::header::HeaderName::from_static("smithy-protocol"),
   44     61   
            "rpc-v2-cbor",
   45     62   
        );
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   46     64   
        let http_status: u16 = 200;
   47     65   
        builder = builder.status(http_status);
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   48     67   
        let payload =
   49         -
            crate::protocol_serde::shape_empty_input_output_output::ser_empty_input_output_output_output_output(&output)?
   50         -
        ;
          68  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_empty_input_output_output::ser_empty_input_output_output_output_output(&output)?
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   51     71   
        let content_length = payload.len();
   52     72   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   53     73   
            builder,
   54     74   
            ::http::header::CONTENT_LENGTH,
   55     75   
            content_length,
   56     76   
        );
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   57     78   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   58     80   
        builder.body(body)?
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   59     82   
    })
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   60     84   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_empty_input_output_output.rs

@@ -1,1 +23,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_empty_input_output_output_output_output(
    3      4   
    value: &crate::output::EmptyInputOutputOutput,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<u8>,
    6      7   
    ::aws_smithy_types::error::operation::SerializationError,
    7      8   
> {
           9  +
    /* CborSerializerGenerator.kt:233 */
    8     10   
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
          11  +
    /* CborSerializerGenerator.kt:235 */
    9     12   
    {
          13  +
        /* CborSerializerGenerator.kt:236 */
   10     14   
        let encoder = &mut encoder;
          15  +
        /* CborSerializerGenerator.kt:403 */
   11     16   
        crate::protocol_serde::shape_empty_input_output_output::ser_empty_input_output_output_output(encoder, value )?;
          17  +
        /* CborSerializerGenerator.kt:235 */
   12     18   
    }
          19  +
    /* CborSerializerGenerator.kt:242 */
   13     20   
    ::std::result::Result::Ok(encoder.into_writer())
          21  +
    /* CborSerializerGenerator.kt:228 */
   14     22   
}
   15     23   
          24  +
/* CborSerializerGenerator.kt:369 */
   16     25   
pub fn ser_empty_input_output_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::EmptyInputOutputOutput,
   19     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* CborSerializerGenerator.kt:377 */
   20     30   
    encoder.begin_map();
          31  +
    /* CborSerializerGenerator.kt:393 */
   21     32   
    encoder.end();
          33  +
    /* CborSerializerGenerator.kt:394 */
   22     34   
    Ok(())
          35  +
    /* CborSerializerGenerator.kt:369 */
   23     36   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_float16.rs

@@ -1,1 +59,84 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_float16_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::Float16Input,
    7      9   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::float16_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_float16_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::Float16Output,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/cbor",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   41     58   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   42     59   
            builder,
   43     60   
            ::http::header::HeaderName::from_static("smithy-protocol"),
   44     61   
            "rpc-v2-cbor",
   45     62   
        );
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   46     64   
        let http_status: u16 = 200;
   47     65   
        builder = builder.status(http_status);
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   48     67   
        let payload =
   49         -
            crate::protocol_serde::shape_float16_output::ser_float16_output_output_output(&output)?;
          68  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_float16_output::ser_float16_output_output_output(&output)?
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   50     71   
        let content_length = payload.len();
   51     72   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     73   
            builder,
   53     74   
            ::http::header::CONTENT_LENGTH,
   54     75   
            content_length,
   55     76   
        );
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   56     78   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   57     80   
        builder.body(body)?
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   58     82   
    })
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   59     84   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_float16_output.rs

@@ -1,1 +26,42 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborSerializerGenerator.kt:228 */
    2      3   
pub fn ser_float16_output_output_output(
    3      4   
    value: &crate::output::Float16Output,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::vec::Vec<u8>,
    6      7   
    ::aws_smithy_types::error::operation::SerializationError,
    7      8   
> {
           9  +
    /* CborSerializerGenerator.kt:233 */
    8     10   
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
          11  +
    /* CborSerializerGenerator.kt:235 */
    9     12   
    {
          13  +
        /* CborSerializerGenerator.kt:236 */
   10     14   
        let encoder = &mut encoder;
          15  +
        /* CborSerializerGenerator.kt:403 */
   11     16   
        crate::protocol_serde::shape_float16_output::ser_float16_output_output(encoder, value)?;
          17  +
        /* CborSerializerGenerator.kt:235 */
   12     18   
    }
          19  +
    /* CborSerializerGenerator.kt:242 */
   13     20   
    ::std::result::Result::Ok(encoder.into_writer())
          21  +
    /* CborSerializerGenerator.kt:228 */
   14     22   
}
   15     23   
          24  +
/* CborSerializerGenerator.kt:369 */
   16     25   
pub fn ser_float16_output_output(
   17     26   
    encoder: &mut ::aws_smithy_cbor::Encoder,
   18     27   
    #[allow(unused)] input: &crate::output::Float16Output,
   19     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* CborSerializerGenerator.kt:377 */
   20     30   
    encoder.begin_map();
          31  +
    /* CborSerializerGenerator.kt:414 */
   21     32   
    if let Some(var_1) = &input.value {
          33  +
        /* CborSerializerGenerator.kt:470 */
   22     34   
        encoder.str("value").double(*var_1);
          35  +
        /* CborSerializerGenerator.kt:414 */
   23     36   
    }
          37  +
    /* CborSerializerGenerator.kt:393 */
   24     38   
    encoder.end();
          39  +
    /* CborSerializerGenerator.kt:394 */
   25     40   
    Ok(())
          41  +
    /* CborSerializerGenerator.kt:369 */
   26     42   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/protocol_serde/shape_foo_enum_list.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CborParserGenerator.kt:616 */
    2      3   
pub(crate) fn de_foo_enum_list(
    3      4   
    decoder: &mut ::aws_smithy_cbor::Decoder,
    4      5   
) -> ::std::result::Result<
    5      6   
    crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained,
    6      7   
    ::aws_smithy_cbor::decode::DeserializeError,
    7      8   
> {
    8      9   
    fn member(
    9     10   
        mut list: crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained,
   10     11   
        decoder: &mut ::aws_smithy_cbor::Decoder,
   11     12   
    ) -> ::std::result::Result<