aws-sdk-ebs 1.97.0

AWS SDK for Amazon Elastic Block Store
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn de_block_data_payload(
    body: &mut ::aws_smithy_types::body::SdkBody,
) -> std::result::Result<::aws_smithy_types::byte_stream::ByteStream, crate::operation::get_snapshot_block::GetSnapshotBlockError> {
    // replace the body with an empty body
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
    Ok(::aws_smithy_types::byte_stream::ByteStream::new(body))
}

pub(crate) fn de_checksum_header(
    header_map: &::aws_smithy_runtime_api::http::Headers,
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
    let headers = header_map.get_all("x-amz-Checksum");
    ::aws_smithy_http::header::one_or_none(headers)
}

pub(crate) fn de_checksum_algorithm_header(
    header_map: &::aws_smithy_runtime_api::http::Headers,
) -> ::std::result::Result<::std::option::Option<crate::types::ChecksumAlgorithm>, ::aws_smithy_http::header::ParseError> {
    let headers = header_map.get_all("x-amz-Checksum-Algorithm");
    ::aws_smithy_http::header::one_or_none(headers)
}

pub(crate) fn de_data_length_header(
    header_map: &::aws_smithy_runtime_api::http::Headers,
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
    let headers = header_map.get_all("x-amz-Data-Length");
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
    if var_1.len() > 1 {
        Err(::aws_smithy_http::header::ParseError::new(format!(
            "expected one item but found {}",
            var_1.len()
        )))
    } else {
        let mut var_1 = var_1;
        Ok(var_1.pop())
    }
}