#[non_exhaustive]pub enum ClusterInstanceType {
Show 39 variants
MlC512Xlarge,
MlC518Xlarge,
MlC524Xlarge,
MlC52Xlarge,
MlC54Xlarge,
MlC59Xlarge,
MlC5Large,
MlC5Xlarge,
MlC5N18Xlarge,
MlC5N2Xlarge,
MlC5N4Xlarge,
MlC5N9Xlarge,
MlC5NLarge,
MlG512Xlarge,
MlG516Xlarge,
MlG524Xlarge,
MlG52Xlarge,
MlG548Xlarge,
MlG54Xlarge,
MlG58Xlarge,
MlG5Xlarge,
MlM512Xlarge,
MlM516Xlarge,
MlM524Xlarge,
MlM52Xlarge,
MlM54Xlarge,
MlM58Xlarge,
MlM5Large,
MlM5Xlarge,
MlP4D24Xlarge,
MlP4De24Xlarge,
MlP548Xlarge,
MlT32Xlarge,
MlT3Large,
MlT3Medium,
MlT3Xlarge,
MlTrn132Xlarge,
MlTrn1N32Xlarge,
Unknown(UnknownVariantValue),
}
Expand description
When writing a match expression against ClusterInstanceType
, 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 clusterinstancetype = unimplemented!();
match clusterinstancetype {
ClusterInstanceType::MlC512Xlarge => { /* ... */ },
ClusterInstanceType::MlC518Xlarge => { /* ... */ },
ClusterInstanceType::MlC524Xlarge => { /* ... */ },
ClusterInstanceType::MlC52Xlarge => { /* ... */ },
ClusterInstanceType::MlC54Xlarge => { /* ... */ },
ClusterInstanceType::MlC59Xlarge => { /* ... */ },
ClusterInstanceType::MlC5Large => { /* ... */ },
ClusterInstanceType::MlC5Xlarge => { /* ... */ },
ClusterInstanceType::MlC5N18Xlarge => { /* ... */ },
ClusterInstanceType::MlC5N2Xlarge => { /* ... */ },
ClusterInstanceType::MlC5N4Xlarge => { /* ... */ },
ClusterInstanceType::MlC5N9Xlarge => { /* ... */ },
ClusterInstanceType::MlC5NLarge => { /* ... */ },
ClusterInstanceType::MlG512Xlarge => { /* ... */ },
ClusterInstanceType::MlG516Xlarge => { /* ... */ },
ClusterInstanceType::MlG524Xlarge => { /* ... */ },
ClusterInstanceType::MlG52Xlarge => { /* ... */ },
ClusterInstanceType::MlG548Xlarge => { /* ... */ },
ClusterInstanceType::MlG54Xlarge => { /* ... */ },
ClusterInstanceType::MlG58Xlarge => { /* ... */ },
ClusterInstanceType::MlG5Xlarge => { /* ... */ },
ClusterInstanceType::MlM512Xlarge => { /* ... */ },
ClusterInstanceType::MlM516Xlarge => { /* ... */ },
ClusterInstanceType::MlM524Xlarge => { /* ... */ },
ClusterInstanceType::MlM52Xlarge => { /* ... */ },
ClusterInstanceType::MlM54Xlarge => { /* ... */ },
ClusterInstanceType::MlM58Xlarge => { /* ... */ },
ClusterInstanceType::MlM5Large => { /* ... */ },
ClusterInstanceType::MlM5Xlarge => { /* ... */ },
ClusterInstanceType::MlP4D24Xlarge => { /* ... */ },
ClusterInstanceType::MlP4De24Xlarge => { /* ... */ },
ClusterInstanceType::MlP548Xlarge => { /* ... */ },
ClusterInstanceType::MlT32Xlarge => { /* ... */ },
ClusterInstanceType::MlT3Large => { /* ... */ },
ClusterInstanceType::MlT3Medium => { /* ... */ },
ClusterInstanceType::MlT3Xlarge => { /* ... */ },
ClusterInstanceType::MlTrn132Xlarge => { /* ... */ },
ClusterInstanceType::MlTrn1N32Xlarge => { /* ... */ },
other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
_ => { /* ... */ },
}
The above code demonstrates that when clusterinstancetype
represents
NewFeature
, the execution path will lead to the second last match arm,
even though the enum does not contain a variant ClusterInstanceType::NewFeature
in the current version of SDK. The reason is that the variable other
,
created by the @
operator, is bound to
ClusterInstanceType::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 ClusterInstanceType::NewFeature
is defined.
Specifically, when clusterinstancetype
represents NewFeature
,
the execution path will hit the second last match arm as before by virtue of
calling as_str
on ClusterInstanceType::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
MlC512Xlarge
MlC518Xlarge
MlC524Xlarge
MlC52Xlarge
MlC54Xlarge
MlC59Xlarge
MlC5Large
MlC5Xlarge
MlC5N18Xlarge
MlC5N2Xlarge
MlC5N4Xlarge
MlC5N9Xlarge
MlC5NLarge
MlG512Xlarge
MlG516Xlarge
MlG524Xlarge
MlG52Xlarge
MlG548Xlarge
MlG54Xlarge
MlG58Xlarge
MlG5Xlarge
MlM512Xlarge
MlM516Xlarge
MlM524Xlarge
MlM52Xlarge
MlM54Xlarge
MlM58Xlarge
MlM5Large
MlM5Xlarge
MlP4D24Xlarge
MlP4De24Xlarge
MlP548Xlarge
MlT32Xlarge
MlT3Large
MlT3Medium
MlT3Xlarge
MlTrn132Xlarge
MlTrn1N32Xlarge
Unknown(UnknownVariantValue)
Unknown
. See the docs on this enum for the correct way to handle unknown variants.Unknown
contains new variants that have been added since this code was generated.
Implementations§
source§impl ClusterInstanceType
impl ClusterInstanceType
sourcepub fn try_parse(value: &str) -> Result<Self, UnknownVariantError>
pub fn try_parse(value: &str) -> Result<Self, UnknownVariantError>
Parses the enum value while disallowing unknown variants.
Unknown variants will result in an error.
Trait Implementations§
source§impl AsRef<str> for ClusterInstanceType
impl AsRef<str> for ClusterInstanceType
source§impl Clone for ClusterInstanceType
impl Clone for ClusterInstanceType
source§fn clone(&self) -> ClusterInstanceType
fn clone(&self) -> ClusterInstanceType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ClusterInstanceType
impl Debug for ClusterInstanceType
source§impl Display for ClusterInstanceType
impl Display for ClusterInstanceType
source§impl From<&str> for ClusterInstanceType
impl From<&str> for ClusterInstanceType
source§impl FromStr for ClusterInstanceType
impl FromStr for ClusterInstanceType
source§impl Hash for ClusterInstanceType
impl Hash for ClusterInstanceType
source§impl Ord for ClusterInstanceType
impl Ord for ClusterInstanceType
source§fn cmp(&self, other: &ClusterInstanceType) -> Ordering
fn cmp(&self, other: &ClusterInstanceType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for ClusterInstanceType
impl PartialEq for ClusterInstanceType
source§impl PartialOrd for ClusterInstanceType
impl PartialOrd for ClusterInstanceType
impl Eq for ClusterInstanceType
impl StructuralPartialEq for ClusterInstanceType
Auto Trait Implementations§
impl Freeze for ClusterInstanceType
impl RefUnwindSafe for ClusterInstanceType
impl Send for ClusterInstanceType
impl Sync for ClusterInstanceType
impl Unpin for ClusterInstanceType
impl UnwindSafe for ClusterInstanceType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more