#[non_exhaustive]
pub enum Select {
    AllAttributes,
    AllProjectedAttributes,
    Count,
    SpecificAttributes,
    Unknown(UnknownVariantValue),
}
Expand description

When writing a match expression against Select, 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 select = unimplemented!();
match select {
    Select::AllAttributes => { /* ... */ },
    Select::AllProjectedAttributes => { /* ... */ },
    Select::Count => { /* ... */ },
    Select::SpecificAttributes => { /* ... */ },
    other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
    _ => { /* ... */ },
}

The above code demonstrates that when select represents NewFeature, the execution path will lead to the second last match arm, even though the enum does not contain a variant Select::NewFeature in the current version of SDK. The reason is that the variable other, created by the @ operator, is bound to Select::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 Select::NewFeature is defined. Specifically, when select represents NewFeature, the execution path will hit the second last match arm as before by virtue of calling as_str on Select::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.
§

AllAttributes

§

AllProjectedAttributes

§

Count

§

SpecificAttributes

§

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 12003)
12002
12003
12004
    fn as_ref(&self) -> &str {
        self.as_str()
    }
More examples
Hide additional examples
src/json_ser.rs (line 929)
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
pub fn serialize_structure_crate_input_query_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::QueryInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_195) = &input.table_name {
        object.key("TableName").string(var_195.as_str());
    }
    if let Some(var_196) = &input.index_name {
        object.key("IndexName").string(var_196.as_str());
    }
    if let Some(var_197) = &input.select {
        object.key("Select").string(var_197.as_str());
    }
    if let Some(var_198) = &input.attributes_to_get {
        let mut array_199 = object.key("AttributesToGet").start_array();
        for item_200 in var_198 {
            {
                array_199.value().string(item_200.as_str());
            }
        }
        array_199.finish();
    }
    if let Some(var_201) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_201).into()),
        );
    }
    if let Some(var_202) = &input.consistent_read {
        object.key("ConsistentRead").boolean(*var_202);
    }
    if let Some(var_203) = &input.key_conditions {
        #[allow(unused_mut)]
        let mut object_204 = object.key("KeyConditions").start_object();
        for (key_205, value_206) in var_203 {
            {
                #[allow(unused_mut)]
                let mut object_207 = object_204.key(key_205.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_condition(
                    &mut object_207,
                    value_206,
                )?;
                object_207.finish();
            }
        }
        object_204.finish();
    }
    if let Some(var_208) = &input.query_filter {
        #[allow(unused_mut)]
        let mut object_209 = object.key("QueryFilter").start_object();
        for (key_210, value_211) in var_208 {
            {
                #[allow(unused_mut)]
                let mut object_212 = object_209.key(key_210.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_condition(
                    &mut object_212,
                    value_211,
                )?;
                object_212.finish();
            }
        }
        object_209.finish();
    }
    if let Some(var_213) = &input.conditional_operator {
        object.key("ConditionalOperator").string(var_213.as_str());
    }
    if let Some(var_214) = &input.scan_index_forward {
        object.key("ScanIndexForward").boolean(*var_214);
    }
    if let Some(var_215) = &input.exclusive_start_key {
        #[allow(unused_mut)]
        let mut object_216 = object.key("ExclusiveStartKey").start_object();
        for (key_217, value_218) in var_215 {
            {
                #[allow(unused_mut)]
                let mut object_219 = object_216.key(key_217.as_str()).start_object();
                crate::json_ser::serialize_union_crate_model_attribute_value(
                    &mut object_219,
                    value_218,
                )?;
                object_219.finish();
            }
        }
        object_216.finish();
    }
    if let Some(var_220) = &input.return_consumed_capacity {
        object
            .key("ReturnConsumedCapacity")
            .string(var_220.as_str());
    }
    if let Some(var_221) = &input.projection_expression {
        object.key("ProjectionExpression").string(var_221.as_str());
    }
    if let Some(var_222) = &input.filter_expression {
        object.key("FilterExpression").string(var_222.as_str());
    }
    if let Some(var_223) = &input.key_condition_expression {
        object
            .key("KeyConditionExpression")
            .string(var_223.as_str());
    }
    if let Some(var_224) = &input.expression_attribute_names {
        #[allow(unused_mut)]
        let mut object_225 = object.key("ExpressionAttributeNames").start_object();
        for (key_226, value_227) in var_224 {
            {
                object_225.key(key_226.as_str()).string(value_227.as_str());
            }
        }
        object_225.finish();
    }
    if let Some(var_228) = &input.expression_attribute_values {
        #[allow(unused_mut)]
        let mut object_229 = object.key("ExpressionAttributeValues").start_object();
        for (key_230, value_231) in var_228 {
            {
                #[allow(unused_mut)]
                let mut object_232 = object_229.key(key_230.as_str()).start_object();
                crate::json_ser::serialize_union_crate_model_attribute_value(
                    &mut object_232,
                    value_231,
                )?;
                object_232.finish();
            }
        }
        object_229.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_restore_table_from_backup_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::RestoreTableFromBackupInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_233) = &input.target_table_name {
        object.key("TargetTableName").string(var_233.as_str());
    }
    if let Some(var_234) = &input.backup_arn {
        object.key("BackupArn").string(var_234.as_str());
    }
    if let Some(var_235) = &input.billing_mode_override {
        object.key("BillingModeOverride").string(var_235.as_str());
    }
    if let Some(var_236) = &input.global_secondary_index_override {
        let mut array_237 = object.key("GlobalSecondaryIndexOverride").start_array();
        for item_238 in var_236 {
            {
                #[allow(unused_mut)]
                let mut object_239 = array_237.value().start_object();
                crate::json_ser::serialize_structure_crate_model_global_secondary_index(
                    &mut object_239,
                    item_238,
                )?;
                object_239.finish();
            }
        }
        array_237.finish();
    }
    if let Some(var_240) = &input.local_secondary_index_override {
        let mut array_241 = object.key("LocalSecondaryIndexOverride").start_array();
        for item_242 in var_240 {
            {
                #[allow(unused_mut)]
                let mut object_243 = array_241.value().start_object();
                crate::json_ser::serialize_structure_crate_model_local_secondary_index(
                    &mut object_243,
                    item_242,
                )?;
                object_243.finish();
            }
        }
        array_241.finish();
    }
    if let Some(var_244) = &input.provisioned_throughput_override {
        #[allow(unused_mut)]
        let mut object_245 = object.key("ProvisionedThroughputOverride").start_object();
        crate::json_ser::serialize_structure_crate_model_provisioned_throughput(
            &mut object_245,
            var_244,
        )?;
        object_245.finish();
    }
    if let Some(var_246) = &input.sse_specification_override {
        #[allow(unused_mut)]
        let mut object_247 = object.key("SSESpecificationOverride").start_object();
        crate::json_ser::serialize_structure_crate_model_sse_specification(
            &mut object_247,
            var_246,
        )?;
        object_247.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_restore_table_to_point_in_time_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::RestoreTableToPointInTimeInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_248) = &input.source_table_arn {
        object.key("SourceTableArn").string(var_248.as_str());
    }
    if let Some(var_249) = &input.source_table_name {
        object.key("SourceTableName").string(var_249.as_str());
    }
    if let Some(var_250) = &input.target_table_name {
        object.key("TargetTableName").string(var_250.as_str());
    }
    if let Some(var_251) = &input.use_latest_restorable_time {
        object.key("UseLatestRestorableTime").boolean(*var_251);
    }
    if let Some(var_252) = &input.restore_date_time {
        object
            .key("RestoreDateTime")
            .date_time(var_252, aws_smithy_types::date_time::Format::EpochSeconds)?;
    }
    if let Some(var_253) = &input.billing_mode_override {
        object.key("BillingModeOverride").string(var_253.as_str());
    }
    if let Some(var_254) = &input.global_secondary_index_override {
        let mut array_255 = object.key("GlobalSecondaryIndexOverride").start_array();
        for item_256 in var_254 {
            {
                #[allow(unused_mut)]
                let mut object_257 = array_255.value().start_object();
                crate::json_ser::serialize_structure_crate_model_global_secondary_index(
                    &mut object_257,
                    item_256,
                )?;
                object_257.finish();
            }
        }
        array_255.finish();
    }
    if let Some(var_258) = &input.local_secondary_index_override {
        let mut array_259 = object.key("LocalSecondaryIndexOverride").start_array();
        for item_260 in var_258 {
            {
                #[allow(unused_mut)]
                let mut object_261 = array_259.value().start_object();
                crate::json_ser::serialize_structure_crate_model_local_secondary_index(
                    &mut object_261,
                    item_260,
                )?;
                object_261.finish();
            }
        }
        array_259.finish();
    }
    if let Some(var_262) = &input.provisioned_throughput_override {
        #[allow(unused_mut)]
        let mut object_263 = object.key("ProvisionedThroughputOverride").start_object();
        crate::json_ser::serialize_structure_crate_model_provisioned_throughput(
            &mut object_263,
            var_262,
        )?;
        object_263.finish();
    }
    if let Some(var_264) = &input.sse_specification_override {
        #[allow(unused_mut)]
        let mut object_265 = object.key("SSESpecificationOverride").start_object();
        crate::json_ser::serialize_structure_crate_model_sse_specification(
            &mut object_265,
            var_264,
        )?;
        object_265.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_scan_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ScanInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_266) = &input.table_name {
        object.key("TableName").string(var_266.as_str());
    }
    if let Some(var_267) = &input.index_name {
        object.key("IndexName").string(var_267.as_str());
    }
    if let Some(var_268) = &input.attributes_to_get {
        let mut array_269 = object.key("AttributesToGet").start_array();
        for item_270 in var_268 {
            {
                array_269.value().string(item_270.as_str());
            }
        }
        array_269.finish();
    }
    if let Some(var_271) = &input.limit {
        object.key("Limit").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_271).into()),
        );
    }
    if let Some(var_272) = &input.select {
        object.key("Select").string(var_272.as_str());
    }
    if let Some(var_273) = &input.scan_filter {
        #[allow(unused_mut)]
        let mut object_274 = object.key("ScanFilter").start_object();
        for (key_275, value_276) in var_273 {
            {
                #[allow(unused_mut)]
                let mut object_277 = object_274.key(key_275.as_str()).start_object();
                crate::json_ser::serialize_structure_crate_model_condition(
                    &mut object_277,
                    value_276,
                )?;
                object_277.finish();
            }
        }
        object_274.finish();
    }
    if let Some(var_278) = &input.conditional_operator {
        object.key("ConditionalOperator").string(var_278.as_str());
    }
    if let Some(var_279) = &input.exclusive_start_key {
        #[allow(unused_mut)]
        let mut object_280 = object.key("ExclusiveStartKey").start_object();
        for (key_281, value_282) in var_279 {
            {
                #[allow(unused_mut)]
                let mut object_283 = object_280.key(key_281.as_str()).start_object();
                crate::json_ser::serialize_union_crate_model_attribute_value(
                    &mut object_283,
                    value_282,
                )?;
                object_283.finish();
            }
        }
        object_280.finish();
    }
    if let Some(var_284) = &input.return_consumed_capacity {
        object
            .key("ReturnConsumedCapacity")
            .string(var_284.as_str());
    }
    if let Some(var_285) = &input.total_segments {
        object.key("TotalSegments").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_285).into()),
        );
    }
    if let Some(var_286) = &input.segment {
        object.key("Segment").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_286).into()),
        );
    }
    if let Some(var_287) = &input.projection_expression {
        object.key("ProjectionExpression").string(var_287.as_str());
    }
    if let Some(var_288) = &input.filter_expression {
        object.key("FilterExpression").string(var_288.as_str());
    }
    if let Some(var_289) = &input.expression_attribute_names {
        #[allow(unused_mut)]
        let mut object_290 = object.key("ExpressionAttributeNames").start_object();
        for (key_291, value_292) in var_289 {
            {
                object_290.key(key_291.as_str()).string(value_292.as_str());
            }
        }
        object_290.finish();
    }
    if let Some(var_293) = &input.expression_attribute_values {
        #[allow(unused_mut)]
        let mut object_294 = object.key("ExpressionAttributeValues").start_object();
        for (key_295, value_296) in var_293 {
            {
                #[allow(unused_mut)]
                let mut object_297 = object_294.key(key_295.as_str()).start_object();
                crate::json_ser::serialize_union_crate_model_attribute_value(
                    &mut object_297,
                    value_296,
                )?;
                object_297.finish();
            }
        }
        object_294.finish();
    }
    if let Some(var_298) = &input.consistent_read {
        object.key("ConsistentRead").boolean(*var_298);
    }
    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