#[non_exhaustive]
pub enum ExportableInstanceField {
Show 53 variants
AccountId,
CurrentInstanceType,
CurrentMemory,
CurrentNetwork,
CurrentOnDemandPrice,
CurrentPerformanceRisk,
CurrentStandardOneYearNoUpfrontReservedPrice,
CurrentStandardThreeYearNoUpfrontReservedPrice,
CurrentStorage,
CurrentVcpus,
EffectiveRecommendationPreferencesCpuVendorArchitectures,
EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics,
EffectiveRecommendationPreferencesInferredWorkloadTypes,
Finding,
FindingReasonCodes,
InferredWorkloadTypes,
InstanceArn,
InstanceName,
LastRefreshTimestamp,
LookbackPeriodInDays,
RecommendationOptionsEstimatedMonthlySavingsCurrency,
RecommendationOptionsEstimatedMonthlySavingsValue,
RecommendationOptionsInstanceType,
RecommendationOptionsMemory,
RecommendationOptionsMigrationEffort,
RecommendationOptionsNetwork,
RecommendationOptionsOnDemandPrice,
RecommendationOptionsPerformanceRisk,
RecommendationOptionsPlatformDifferences,
RecommendationOptionsProjectedUtilizationMetricsCpuMaximum,
RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum,
RecommendationOptionsSavingsOpportunityPercentage,
RecommendationOptionsStandardOneYearNoUpfrontReservedPrice,
RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice,
RecommendationOptionsStorage,
RecommendationOptionsVcpus,
RecommendationsSourcesRecommendationSourceArn,
RecommendationsSourcesRecommendationSourceType,
UtilizationMetricsCpuMaximum,
UtilizationMetricsDiskReadBytesPerSecondMaximum,
UtilizationMetricsDiskReadOpsPerSecondMaximum,
UtilizationMetricsDiskWriteBytesPerSecondMaximum,
UtilizationMetricsDiskWriteOpsPerSecondMaximum,
UtilizationMetricsEbsReadBytesPerSecondMaximum,
UtilizationMetricsEbsReadOpsPerSecondMaximum,
UtilizationMetricsEbsWriteBytesPerSecondMaximum,
UtilizationMetricsEbsWriteOpsPerSecondMaximum,
UtilizationMetricsMemoryMaximum,
UtilizationMetricsNetworkInBytesPerSecondMaximum,
UtilizationMetricsNetworkOutBytesPerSecondMaximum,
UtilizationMetricsNetworkPacketsInPerSecondMaximum,
UtilizationMetricsNetworkPacketsOutPerSecondMaximum,
Unknown(UnknownVariantValue),
}
Expand description
When writing a match expression against ExportableInstanceField
, 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 exportableinstancefield = unimplemented!();
match exportableinstancefield {
ExportableInstanceField::AccountId => { /* ... */ },
ExportableInstanceField::CurrentInstanceType => { /* ... */ },
ExportableInstanceField::CurrentMemory => { /* ... */ },
ExportableInstanceField::CurrentNetwork => { /* ... */ },
ExportableInstanceField::CurrentOnDemandPrice => { /* ... */ },
ExportableInstanceField::CurrentPerformanceRisk => { /* ... */ },
ExportableInstanceField::CurrentStandardOneYearNoUpfrontReservedPrice => { /* ... */ },
ExportableInstanceField::CurrentStandardThreeYearNoUpfrontReservedPrice => { /* ... */ },
ExportableInstanceField::CurrentStorage => { /* ... */ },
ExportableInstanceField::CurrentVcpus => { /* ... */ },
ExportableInstanceField::EffectiveRecommendationPreferencesCpuVendorArchitectures => { /* ... */ },
ExportableInstanceField::EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics => { /* ... */ },
ExportableInstanceField::EffectiveRecommendationPreferencesInferredWorkloadTypes => { /* ... */ },
ExportableInstanceField::Finding => { /* ... */ },
ExportableInstanceField::FindingReasonCodes => { /* ... */ },
ExportableInstanceField::InferredWorkloadTypes => { /* ... */ },
ExportableInstanceField::InstanceArn => { /* ... */ },
ExportableInstanceField::InstanceName => { /* ... */ },
ExportableInstanceField::LastRefreshTimestamp => { /* ... */ },
ExportableInstanceField::LookbackPeriodInDays => { /* ... */ },
ExportableInstanceField::RecommendationOptionsEstimatedMonthlySavingsCurrency => { /* ... */ },
ExportableInstanceField::RecommendationOptionsEstimatedMonthlySavingsValue => { /* ... */ },
ExportableInstanceField::RecommendationOptionsInstanceType => { /* ... */ },
ExportableInstanceField::RecommendationOptionsMemory => { /* ... */ },
ExportableInstanceField::RecommendationOptionsMigrationEffort => { /* ... */ },
ExportableInstanceField::RecommendationOptionsNetwork => { /* ... */ },
ExportableInstanceField::RecommendationOptionsOnDemandPrice => { /* ... */ },
ExportableInstanceField::RecommendationOptionsPerformanceRisk => { /* ... */ },
ExportableInstanceField::RecommendationOptionsPlatformDifferences => { /* ... */ },
ExportableInstanceField::RecommendationOptionsProjectedUtilizationMetricsCpuMaximum => { /* ... */ },
ExportableInstanceField::RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum => { /* ... */ },
ExportableInstanceField::RecommendationOptionsSavingsOpportunityPercentage => { /* ... */ },
ExportableInstanceField::RecommendationOptionsStandardOneYearNoUpfrontReservedPrice => { /* ... */ },
ExportableInstanceField::RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice => { /* ... */ },
ExportableInstanceField::RecommendationOptionsStorage => { /* ... */ },
ExportableInstanceField::RecommendationOptionsVcpus => { /* ... */ },
ExportableInstanceField::RecommendationsSourcesRecommendationSourceArn => { /* ... */ },
ExportableInstanceField::RecommendationsSourcesRecommendationSourceType => { /* ... */ },
ExportableInstanceField::UtilizationMetricsCpuMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsDiskReadBytesPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsDiskReadOpsPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsDiskWriteBytesPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsDiskWriteOpsPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsEbsReadBytesPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsEbsReadOpsPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsEbsWriteBytesPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsEbsWriteOpsPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsMemoryMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsNetworkInBytesPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsNetworkOutBytesPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsNetworkPacketsInPerSecondMaximum => { /* ... */ },
ExportableInstanceField::UtilizationMetricsNetworkPacketsOutPerSecondMaximum => { /* ... */ },
other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
_ => { /* ... */ },
}
The above code demonstrates that when exportableinstancefield
represents
NewFeature
, the execution path will lead to the second last match arm,
even though the enum does not contain a variant ExportableInstanceField::NewFeature
in the current version of SDK. The reason is that the variable other
,
created by the @
operator, is bound to
ExportableInstanceField::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 ExportableInstanceField::NewFeature
is defined.
Specifically, when exportableinstancefield
represents NewFeature
,
the execution path will hit the second last match arm as before by virtue of
calling as_str
on ExportableInstanceField::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
AccountId
CurrentInstanceType
CurrentMemory
CurrentNetwork
CurrentOnDemandPrice
CurrentPerformanceRisk
CurrentStandardOneYearNoUpfrontReservedPrice
CurrentStandardThreeYearNoUpfrontReservedPrice
CurrentStorage
CurrentVcpus
EffectiveRecommendationPreferencesCpuVendorArchitectures
EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics
EffectiveRecommendationPreferencesInferredWorkloadTypes
Finding
FindingReasonCodes
InferredWorkloadTypes
InstanceArn
InstanceName
LastRefreshTimestamp
LookbackPeriodInDays
RecommendationOptionsEstimatedMonthlySavingsCurrency
RecommendationOptionsEstimatedMonthlySavingsValue
RecommendationOptionsInstanceType
RecommendationOptionsMemory
RecommendationOptionsMigrationEffort
RecommendationOptionsNetwork
RecommendationOptionsOnDemandPrice
RecommendationOptionsPerformanceRisk
RecommendationOptionsPlatformDifferences
RecommendationOptionsProjectedUtilizationMetricsCpuMaximum
RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum
RecommendationOptionsSavingsOpportunityPercentage
RecommendationOptionsStandardOneYearNoUpfrontReservedPrice
RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice
RecommendationOptionsStorage
RecommendationOptionsVcpus
RecommendationsSourcesRecommendationSourceArn
RecommendationsSourcesRecommendationSourceType
UtilizationMetricsCpuMaximum
UtilizationMetricsDiskReadBytesPerSecondMaximum
UtilizationMetricsDiskReadOpsPerSecondMaximum
UtilizationMetricsDiskWriteBytesPerSecondMaximum
UtilizationMetricsDiskWriteOpsPerSecondMaximum
UtilizationMetricsEbsReadBytesPerSecondMaximum
UtilizationMetricsEbsReadOpsPerSecondMaximum
UtilizationMetricsEbsWriteBytesPerSecondMaximum
UtilizationMetricsEbsWriteOpsPerSecondMaximum
UtilizationMetricsMemoryMaximum
UtilizationMetricsNetworkInBytesPerSecondMaximum
UtilizationMetricsNetworkOutBytesPerSecondMaximum
UtilizationMetricsNetworkPacketsInPerSecondMaximum
UtilizationMetricsNetworkPacketsOutPerSecondMaximum
Unknown(UnknownVariantValue)
Unknown
contains new variants that have been added since this code was generated.
Implementations§
source§impl ExportableInstanceField
impl ExportableInstanceField
sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the &str
value of the enum member.
Examples found in repository?
More examples
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
pub fn serialize_structure_crate_input_export_ec2_instance_recommendations_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ExportEc2InstanceRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_44) = &input.account_ids {
let mut array_45 = object.key("accountIds").start_array();
for item_46 in var_44 {
{
array_45.value().string(item_46.as_str());
}
}
array_45.finish();
}
if let Some(var_47) = &input.filters {
let mut array_48 = object.key("filters").start_array();
for item_49 in var_47 {
{
#[allow(unused_mut)]
let mut object_50 = array_48.value().start_object();
crate::json_ser::serialize_structure_crate_model_filter(&mut object_50, item_49)?;
object_50.finish();
}
}
array_48.finish();
}
if let Some(var_51) = &input.fields_to_export {
let mut array_52 = object.key("fieldsToExport").start_array();
for item_53 in var_51 {
{
array_52.value().string(item_53.as_str());
}
}
array_52.finish();
}
if let Some(var_54) = &input.s3_destination_config {
#[allow(unused_mut)]
let mut object_55 = object.key("s3DestinationConfig").start_object();
crate::json_ser::serialize_structure_crate_model_s3_destination_config(
&mut object_55,
var_54,
)?;
object_55.finish();
}
if let Some(var_56) = &input.file_format {
object.key("fileFormat").string(var_56.as_str());
}
if input.include_member_accounts {
object
.key("includeMemberAccounts")
.boolean(input.include_member_accounts);
}
if let Some(var_57) = &input.recommendation_preferences {
#[allow(unused_mut)]
let mut object_58 = object.key("recommendationPreferences").start_object();
crate::json_ser::serialize_structure_crate_model_recommendation_preferences(
&mut object_58,
var_57,
)?;
object_58.finish();
}
Ok(())
}
Trait Implementations§
source§impl AsRef<str> for ExportableInstanceField
impl AsRef<str> for ExportableInstanceField
source§impl Clone for ExportableInstanceField
impl Clone for ExportableInstanceField
source§fn clone(&self) -> ExportableInstanceField
fn clone(&self) -> ExportableInstanceField
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ExportableInstanceField
impl Debug for ExportableInstanceField
source§impl From<&str> for ExportableInstanceField
impl From<&str> for ExportableInstanceField
source§impl FromStr for ExportableInstanceField
impl FromStr for ExportableInstanceField
source§impl Hash for ExportableInstanceField
impl Hash for ExportableInstanceField
source§impl Ord for ExportableInstanceField
impl Ord for ExportableInstanceField
source§fn cmp(&self, other: &ExportableInstanceField) -> Ordering
fn cmp(&self, other: &ExportableInstanceField) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<ExportableInstanceField> for ExportableInstanceField
impl PartialEq<ExportableInstanceField> for ExportableInstanceField
source§fn eq(&self, other: &ExportableInstanceField) -> bool
fn eq(&self, other: &ExportableInstanceField) -> bool
source§impl PartialOrd<ExportableInstanceField> for ExportableInstanceField
impl PartialOrd<ExportableInstanceField> for ExportableInstanceField
source§fn partial_cmp(&self, other: &ExportableInstanceField) -> Option<Ordering>
fn partial_cmp(&self, other: &ExportableInstanceField) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for ExportableInstanceField
impl StructuralEq for ExportableInstanceField
impl StructuralPartialEq for ExportableInstanceField
Auto Trait Implementations§
impl RefUnwindSafe for ExportableInstanceField
impl Send for ExportableInstanceField
impl Sync for ExportableInstanceField
impl Unpin for ExportableInstanceField
impl UnwindSafe for ExportableInstanceField
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.