#[non_exhaustive]
pub enum Protocol {
    Http,
    Https,
    Unknown(UnknownVariantValue),
}
Expand description

When writing a match expression against Protocol, it is important to ensure your code is forward-compatible. That is, if a match arm handles a case for a feature that is supported by the service but has not been represented as an enum variant in a current version of SDK, your code should continue to work when you upgrade SDK to a future version in which the enum does include a variant for that feature.

Here is an example of how you can make a match expression forward-compatible:

# let protocol = unimplemented!();
match protocol {
    Protocol::Http => { /* ... */ },
    Protocol::Https => { /* ... */ },
    other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
    _ => { /* ... */ },
}

The above code demonstrates that when protocol represents NewFeature, the execution path will lead to the second last match arm, even though the enum does not contain a variant Protocol::NewFeature in the current version of SDK. The reason is that the variable other, created by the @ operator, is bound to Protocol::Unknown(UnknownVariantValue("NewFeature".to_owned())) and calling as_str on it yields "NewFeature". This match expression is forward-compatible when executed with a newer version of SDK where the variant Protocol::NewFeature is defined. Specifically, when protocol represents NewFeature, the execution path will hit the second last match arm as before by virtue of calling as_str on Protocol::NewFeature also yielding "NewFeature".

Explicitly matching on the Unknown variant should be avoided for two reasons:

  • The inner data UnknownVariantValue is opaque, and no further information can be extracted.
  • It might inadvertently shadow other intended match arms.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Http

§

Https

§

Unknown(UnknownVariantValue)

Unknown contains new variants that have been added since this code was generated.

Implementations§

Returns the &str value of the enum member.

Examples found in repository?
src/model.rs (line 5581)
5580
5581
5582
    fn as_ref(&self) -> &str {
        self.as_str()
    }
More examples
Hide additional examples
src/xml_ser.rs (line 1779)
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
pub fn serialize_structure_crate_model_redirect_all_requests_to(
    input: &crate::model::RedirectAllRequestsTo,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_151) = &input.host_name {
        let mut inner_writer = scope.start_el("HostName").finish();
        inner_writer.data(var_151.as_str());
    }
    if let Some(var_152) = &input.protocol {
        let mut inner_writer = scope.start_el("Protocol").finish();
        inner_writer.data(var_152.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_routing_rule(
    input: &crate::model::RoutingRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_153) = &input.condition {
        let inner_writer = scope.start_el("Condition");
        crate::xml_ser::serialize_structure_crate_model_condition(var_153, inner_writer)?
    }
    if let Some(var_154) = &input.redirect {
        let inner_writer = scope.start_el("Redirect");
        crate::xml_ser::serialize_structure_crate_model_redirect(var_154, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_object_lock_rule(
    input: &crate::model::ObjectLockRule,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_155) = &input.default_retention {
        let inner_writer = scope.start_el("DefaultRetention");
        crate::xml_ser::serialize_structure_crate_model_default_retention(var_155, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_glacier_job_parameters(
    input: &crate::model::GlacierJobParameters,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_156) = &input.tier {
        let mut inner_writer = scope.start_el("Tier").finish();
        inner_writer.data(var_156.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_select_parameters(
    input: &crate::model::SelectParameters,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_157) = &input.input_serialization {
        let inner_writer = scope.start_el("InputSerialization");
        crate::xml_ser::serialize_structure_crate_model_input_serialization(var_157, inner_writer)?
    }
    if let Some(var_158) = &input.expression_type {
        let mut inner_writer = scope.start_el("ExpressionType").finish();
        inner_writer.data(var_158.as_str());
    }
    if let Some(var_159) = &input.expression {
        let mut inner_writer = scope.start_el("Expression").finish();
        inner_writer.data(var_159.as_str());
    }
    if let Some(var_160) = &input.output_serialization {
        let inner_writer = scope.start_el("OutputSerialization");
        crate::xml_ser::serialize_structure_crate_model_output_serialization(var_160, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_output_location(
    input: &crate::model::OutputLocation,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_161) = &input.s3 {
        let inner_writer = scope.start_el("S3");
        crate::xml_ser::serialize_structure_crate_model_s3_location(var_161, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_csv_input(
    input: &crate::model::CsvInput,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_162) = &input.file_header_info {
        let mut inner_writer = scope.start_el("FileHeaderInfo").finish();
        inner_writer.data(var_162.as_str());
    }
    if let Some(var_163) = &input.comments {
        let mut inner_writer = scope.start_el("Comments").finish();
        inner_writer.data(var_163.as_str());
    }
    if let Some(var_164) = &input.quote_escape_character {
        let mut inner_writer = scope.start_el("QuoteEscapeCharacter").finish();
        inner_writer.data(var_164.as_str());
    }
    if let Some(var_165) = &input.record_delimiter {
        let mut inner_writer = scope.start_el("RecordDelimiter").finish();
        inner_writer.data(var_165.as_str());
    }
    if let Some(var_166) = &input.field_delimiter {
        let mut inner_writer = scope.start_el("FieldDelimiter").finish();
        inner_writer.data(var_166.as_str());
    }
    if let Some(var_167) = &input.quote_character {
        let mut inner_writer = scope.start_el("QuoteCharacter").finish();
        inner_writer.data(var_167.as_str());
    }
    if input.allow_quoted_record_delimiter {
        let mut inner_writer = scope.start_el("AllowQuotedRecordDelimiter").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.allow_quoted_record_delimiter)
                .encode(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_json_input(
    input: &crate::model::JsonInput,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_168) = &input.r#type {
        let mut inner_writer = scope.start_el("Type").finish();
        inner_writer.data(var_168.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_csv_output(
    input: &crate::model::CsvOutput,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_169) = &input.quote_fields {
        let mut inner_writer = scope.start_el("QuoteFields").finish();
        inner_writer.data(var_169.as_str());
    }
    if let Some(var_170) = &input.quote_escape_character {
        let mut inner_writer = scope.start_el("QuoteEscapeCharacter").finish();
        inner_writer.data(var_170.as_str());
    }
    if let Some(var_171) = &input.record_delimiter {
        let mut inner_writer = scope.start_el("RecordDelimiter").finish();
        inner_writer.data(var_171.as_str());
    }
    if let Some(var_172) = &input.field_delimiter {
        let mut inner_writer = scope.start_el("FieldDelimiter").finish();
        inner_writer.data(var_172.as_str());
    }
    if let Some(var_173) = &input.quote_character {
        let mut inner_writer = scope.start_el("QuoteCharacter").finish();
        inner_writer.data(var_173.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_json_output(
    input: &crate::model::JsonOutput,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_174) = &input.record_delimiter {
        let mut inner_writer = scope.start_el("RecordDelimiter").finish();
        inner_writer.data(var_174.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_grantee(
    input: &crate::model::Grantee,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    let mut writer = writer;
    if let Some(var_175) = &input.r#type {
        writer.write_attribute("xsi:type", var_175.as_str());
    }
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_176) = &input.display_name {
        let mut inner_writer = scope.start_el("DisplayName").finish();
        inner_writer.data(var_176.as_str());
    }
    if let Some(var_177) = &input.email_address {
        let mut inner_writer = scope.start_el("EmailAddress").finish();
        inner_writer.data(var_177.as_str());
    }
    if let Some(var_178) = &input.id {
        let mut inner_writer = scope.start_el("ID").finish();
        inner_writer.data(var_178.as_str());
    }
    if let Some(var_179) = &input.uri {
        let mut inner_writer = scope.start_el("URI").finish();
        inner_writer.data(var_179.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_analytics_and_operator(
    input: &crate::model::AnalyticsAndOperator,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_180) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_180.as_str());
    }
    if let Some(var_181) = &input.tags {
        for list_item_182 in var_181 {
            {
                let inner_writer = scope.start_el("Tag");
                crate::xml_ser::serialize_structure_crate_model_tag(list_item_182, inner_writer)?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_storage_class_analysis_data_export(
    input: &crate::model::StorageClassAnalysisDataExport,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_183) = &input.output_schema_version {
        let mut inner_writer = scope.start_el("OutputSchemaVersion").finish();
        inner_writer.data(var_183.as_str());
    }
    if let Some(var_184) = &input.destination {
        let inner_writer = scope.start_el("Destination");
        crate::xml_ser::serialize_structure_crate_model_analytics_export_destination(
            var_184,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_server_side_encryption_by_default(
    input: &crate::model::ServerSideEncryptionByDefault,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_185) = &input.sse_algorithm {
        let mut inner_writer = scope.start_el("SSEAlgorithm").finish();
        inner_writer.data(var_185.as_str());
    }
    if let Some(var_186) = &input.kms_master_key_id {
        let mut inner_writer = scope.start_el("KMSMasterKeyID").finish();
        inner_writer.data(var_186.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_intelligent_tiering_and_operator(
    input: &crate::model::IntelligentTieringAndOperator,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_187) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_187.as_str());
    }
    if let Some(var_188) = &input.tags {
        for list_item_189 in var_188 {
            {
                let inner_writer = scope.start_el("Tag");
                crate::xml_ser::serialize_structure_crate_model_tag(list_item_189, inner_writer)?
            }
        }
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_inventory_s3_bucket_destination(
    input: &crate::model::InventoryS3BucketDestination,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_190) = &input.account_id {
        let mut inner_writer = scope.start_el("AccountId").finish();
        inner_writer.data(var_190.as_str());
    }
    if let Some(var_191) = &input.bucket {
        let mut inner_writer = scope.start_el("Bucket").finish();
        inner_writer.data(var_191.as_str());
    }
    if let Some(var_192) = &input.format {
        let mut inner_writer = scope.start_el("Format").finish();
        inner_writer.data(var_192.as_str());
    }
    if let Some(var_193) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_193.as_str());
    }
    if let Some(var_194) = &input.encryption {
        let inner_writer = scope.start_el("Encryption");
        crate::xml_ser::serialize_structure_crate_model_inventory_encryption(var_194, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_lifecycle_expiration(
    input: &crate::model::LifecycleExpiration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_195) = &input.date {
        let mut inner_writer = scope.start_el("Date").finish();
        inner_writer.data(
            var_195
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if input.days != 0 {
        let mut inner_writer = scope.start_el("Days").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.days).encode());
    }
    if input.expired_object_delete_marker {
        let mut inner_writer = scope.start_el("ExpiredObjectDeleteMarker").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.expired_object_delete_marker).encode(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_union_crate_model_lifecycle_rule_filter(
    input: &crate::model::LifecycleRuleFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::LifecycleRuleFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer.start_el("Prefix").finish();
            inner_writer.data(inner.as_str());
        }
        crate::model::LifecycleRuleFilter::Tag(inner) => {
            let inner_writer = scope_writer.start_el("Tag");
            crate::xml_ser::serialize_structure_crate_model_tag(inner, inner_writer)?
        }
        crate::model::LifecycleRuleFilter::ObjectSizeGreaterThan(inner) => {
            let mut inner_writer = scope_writer.start_el("ObjectSizeGreaterThan").finish();
            inner_writer.data(aws_smithy_types::primitive::Encoder::from(*inner).encode());
        }
        crate::model::LifecycleRuleFilter::ObjectSizeLessThan(inner) => {
            let mut inner_writer = scope_writer.start_el("ObjectSizeLessThan").finish();
            inner_writer.data(aws_smithy_types::primitive::Encoder::from(*inner).encode());
        }
        crate::model::LifecycleRuleFilter::And(inner) => {
            let inner_writer = scope_writer.start_el("And");
            crate::xml_ser::serialize_structure_crate_model_lifecycle_rule_and_operator(
                inner,
                inner_writer,
            )?
        }
        crate::model::LifecycleRuleFilter::Unknown => {
            return Err(
                aws_smithy_http::operation::error::SerializationError::unknown_variant(
                    "LifecycleRuleFilter",
                ),
            )
        }
    }
    Ok(())
}

pub fn serialize_structure_crate_model_transition(
    input: &crate::model::Transition,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_196) = &input.date {
        let mut inner_writer = scope.start_el("Date").finish();
        inner_writer.data(
            var_196
                .fmt(aws_smithy_types::date_time::Format::DateTime)?
                .as_ref(),
        );
    }
    if input.days != 0 {
        let mut inner_writer = scope.start_el("Days").finish();
        inner_writer.data(aws_smithy_types::primitive::Encoder::from(input.days).encode());
    }
    if let Some(var_197) = &input.storage_class {
        let mut inner_writer = scope.start_el("StorageClass").finish();
        inner_writer.data(var_197.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_noncurrent_version_transition(
    input: &crate::model::NoncurrentVersionTransition,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.noncurrent_days != 0 {
        let mut inner_writer = scope.start_el("NoncurrentDays").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.noncurrent_days).encode());
    }
    if let Some(var_198) = &input.storage_class {
        let mut inner_writer = scope.start_el("StorageClass").finish();
        inner_writer.data(var_198.as_str());
    }
    if input.newer_noncurrent_versions != 0 {
        let mut inner_writer = scope.start_el("NewerNoncurrentVersions").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.newer_noncurrent_versions).encode(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_noncurrent_version_expiration(
    input: &crate::model::NoncurrentVersionExpiration,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.noncurrent_days != 0 {
        let mut inner_writer = scope.start_el("NoncurrentDays").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.noncurrent_days).encode());
    }
    if input.newer_noncurrent_versions != 0 {
        let mut inner_writer = scope.start_el("NewerNoncurrentVersions").finish();
        inner_writer.data(
            aws_smithy_types::primitive::Encoder::from(input.newer_noncurrent_versions).encode(),
        );
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_abort_incomplete_multipart_upload(
    input: &crate::model::AbortIncompleteMultipartUpload,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if input.days_after_initiation != 0 {
        let mut inner_writer = scope.start_el("DaysAfterInitiation").finish();
        inner_writer
            .data(aws_smithy_types::primitive::Encoder::from(input.days_after_initiation).encode());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_target_grant(
    input: &crate::model::TargetGrant,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_199) = &input.grantee {
        let inner_writer = scope
            .start_el("Grantee")
            .write_ns("http://www.w3.org/2001/XMLSchema-instance", Some("xsi"));
        crate::xml_ser::serialize_structure_crate_model_grantee(var_199, inner_writer)?
    }
    if let Some(var_200) = &input.permission {
        let mut inner_writer = scope.start_el("Permission").finish();
        inner_writer.data(var_200.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_metrics_and_operator(
    input: &crate::model::MetricsAndOperator,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_201) = &input.prefix {
        let mut inner_writer = scope.start_el("Prefix").finish();
        inner_writer.data(var_201.as_str());
    }
    if let Some(var_202) = &input.tags {
        for list_item_203 in var_202 {
            {
                let inner_writer = scope.start_el("Tag");
                crate::xml_ser::serialize_structure_crate_model_tag(list_item_203, inner_writer)?
            }
        }
    }
    if let Some(var_204) = &input.access_point_arn {
        let mut inner_writer = scope.start_el("AccessPointArn").finish();
        inner_writer.data(var_204.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_notification_configuration_filter(
    input: &crate::model::NotificationConfigurationFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_205) = &input.key {
        let inner_writer = scope.start_el("S3Key");
        crate::xml_ser::serialize_structure_crate_model_s3_key_filter(var_205, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_union_crate_model_replication_rule_filter(
    input: &crate::model::ReplicationRuleFilter,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    let mut scope_writer = writer.finish();
    match input {
        crate::model::ReplicationRuleFilter::Prefix(inner) => {
            let mut inner_writer = scope_writer.start_el("Prefix").finish();
            inner_writer.data(inner.as_str());
        }
        crate::model::ReplicationRuleFilter::Tag(inner) => {
            let inner_writer = scope_writer.start_el("Tag");
            crate::xml_ser::serialize_structure_crate_model_tag(inner, inner_writer)?
        }
        crate::model::ReplicationRuleFilter::And(inner) => {
            let inner_writer = scope_writer.start_el("And");
            crate::xml_ser::serialize_structure_crate_model_replication_rule_and_operator(
                inner,
                inner_writer,
            )?
        }
        crate::model::ReplicationRuleFilter::Unknown => {
            return Err(
                aws_smithy_http::operation::error::SerializationError::unknown_variant(
                    "ReplicationRuleFilter",
                ),
            )
        }
    }
    Ok(())
}

pub fn serialize_structure_crate_model_source_selection_criteria(
    input: &crate::model::SourceSelectionCriteria,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_206) = &input.sse_kms_encrypted_objects {
        let inner_writer = scope.start_el("SseKmsEncryptedObjects");
        crate::xml_ser::serialize_structure_crate_model_sse_kms_encrypted_objects(
            var_206,
            inner_writer,
        )?
    }
    if let Some(var_207) = &input.replica_modifications {
        let inner_writer = scope.start_el("ReplicaModifications");
        crate::xml_ser::serialize_structure_crate_model_replica_modifications(
            var_207,
            inner_writer,
        )?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_existing_object_replication(
    input: &crate::model::ExistingObjectReplication,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_208) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_208.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_destination(
    input: &crate::model::Destination,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_209) = &input.bucket {
        let mut inner_writer = scope.start_el("Bucket").finish();
        inner_writer.data(var_209.as_str());
    }
    if let Some(var_210) = &input.account {
        let mut inner_writer = scope.start_el("Account").finish();
        inner_writer.data(var_210.as_str());
    }
    if let Some(var_211) = &input.storage_class {
        let mut inner_writer = scope.start_el("StorageClass").finish();
        inner_writer.data(var_211.as_str());
    }
    if let Some(var_212) = &input.access_control_translation {
        let inner_writer = scope.start_el("AccessControlTranslation");
        crate::xml_ser::serialize_structure_crate_model_access_control_translation(
            var_212,
            inner_writer,
        )?
    }
    if let Some(var_213) = &input.encryption_configuration {
        let inner_writer = scope.start_el("EncryptionConfiguration");
        crate::xml_ser::serialize_structure_crate_model_encryption_configuration(
            var_213,
            inner_writer,
        )?
    }
    if let Some(var_214) = &input.replication_time {
        let inner_writer = scope.start_el("ReplicationTime");
        crate::xml_ser::serialize_structure_crate_model_replication_time(var_214, inner_writer)?
    }
    if let Some(var_215) = &input.metrics {
        let inner_writer = scope.start_el("Metrics");
        crate::xml_ser::serialize_structure_crate_model_metrics(var_215, inner_writer)?
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_delete_marker_replication(
    input: &crate::model::DeleteMarkerReplication,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_216) = &input.status {
        let mut inner_writer = scope.start_el("Status").finish();
        inner_writer.data(var_216.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_condition(
    input: &crate::model::Condition,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_217) = &input.http_error_code_returned_equals {
        let mut inner_writer = scope.start_el("HttpErrorCodeReturnedEquals").finish();
        inner_writer.data(var_217.as_str());
    }
    if let Some(var_218) = &input.key_prefix_equals {
        let mut inner_writer = scope.start_el("KeyPrefixEquals").finish();
        inner_writer.data(var_218.as_str());
    }
    scope.finish();
    Ok(())
}

pub fn serialize_structure_crate_model_redirect(
    input: &crate::model::Redirect,
    writer: aws_smithy_xml::encode::ElWriter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    #[allow(unused_mut)]
    let mut scope = writer.finish();
    if let Some(var_219) = &input.host_name {
        let mut inner_writer = scope.start_el("HostName").finish();
        inner_writer.data(var_219.as_str());
    }
    if let Some(var_220) = &input.http_redirect_code {
        let mut inner_writer = scope.start_el("HttpRedirectCode").finish();
        inner_writer.data(var_220.as_str());
    }
    if let Some(var_221) = &input.protocol {
        let mut inner_writer = scope.start_el("Protocol").finish();
        inner_writer.data(var_221.as_str());
    }
    if let Some(var_222) = &input.replace_key_prefix_with {
        let mut inner_writer = scope.start_el("ReplaceKeyPrefixWith").finish();
        inner_writer.data(var_222.as_str());
    }
    if let Some(var_223) = &input.replace_key_with {
        let mut inner_writer = scope.start_el("ReplaceKeyWith").finish();
        inner_writer.data(var_223.as_str());
    }
    scope.finish();
    Ok(())
}

Returns all the &str values of the enum members.

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more