Enum aws_sdk_lambda::types::Runtime
source · #[non_exhaustive]pub enum Runtime {
Show 39 variants
Dotnet6,
Dotnet8,
Dotnetcore10,
Dotnetcore20,
Dotnetcore21,
Dotnetcore31,
Go1x,
Java11,
Java17,
Java21,
Java8,
Java8al2,
Nodejs,
Nodejs10x,
Nodejs12x,
Nodejs14x,
Nodejs16x,
Nodejs18x,
Nodejs20x,
Nodejs43,
Nodejs43edge,
Nodejs610,
Nodejs810,
Provided,
Providedal2,
Providedal2023,
Python27,
Python310,
Python311,
Python312,
Python36,
Python37,
Python38,
Python39,
Ruby25,
Ruby27,
Ruby32,
Ruby33,
Unknown(UnknownVariantValue),
}Expand description
When writing a match expression against Runtime, 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 runtime = unimplemented!();
match runtime {
Runtime::Dotnet6 => { /* ... */ },
Runtime::Dotnet8 => { /* ... */ },
Runtime::Dotnetcore10 => { /* ... */ },
Runtime::Dotnetcore20 => { /* ... */ },
Runtime::Dotnetcore21 => { /* ... */ },
Runtime::Dotnetcore31 => { /* ... */ },
Runtime::Go1x => { /* ... */ },
Runtime::Java11 => { /* ... */ },
Runtime::Java17 => { /* ... */ },
Runtime::Java21 => { /* ... */ },
Runtime::Java8 => { /* ... */ },
Runtime::Java8al2 => { /* ... */ },
Runtime::Nodejs => { /* ... */ },
Runtime::Nodejs10x => { /* ... */ },
Runtime::Nodejs12x => { /* ... */ },
Runtime::Nodejs14x => { /* ... */ },
Runtime::Nodejs16x => { /* ... */ },
Runtime::Nodejs18x => { /* ... */ },
Runtime::Nodejs20x => { /* ... */ },
Runtime::Nodejs43 => { /* ... */ },
Runtime::Nodejs43edge => { /* ... */ },
Runtime::Nodejs610 => { /* ... */ },
Runtime::Nodejs810 => { /* ... */ },
Runtime::Provided => { /* ... */ },
Runtime::Providedal2 => { /* ... */ },
Runtime::Providedal2023 => { /* ... */ },
Runtime::Python27 => { /* ... */ },
Runtime::Python310 => { /* ... */ },
Runtime::Python311 => { /* ... */ },
Runtime::Python312 => { /* ... */ },
Runtime::Python36 => { /* ... */ },
Runtime::Python37 => { /* ... */ },
Runtime::Python38 => { /* ... */ },
Runtime::Python39 => { /* ... */ },
Runtime::Ruby25 => { /* ... */ },
Runtime::Ruby27 => { /* ... */ },
Runtime::Ruby32 => { /* ... */ },
Runtime::Ruby33 => { /* ... */ },
other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
_ => { /* ... */ },
}
The above code demonstrates that when runtime represents
NewFeature, the execution path will lead to the second last match arm,
even though the enum does not contain a variant Runtime::NewFeature
in the current version of SDK. The reason is that the variable other,
created by the @ operator, is bound to
Runtime::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 Runtime::NewFeature is defined.
Specifically, when runtime represents NewFeature,
the execution path will hit the second last match arm as before by virtue of
calling as_str on Runtime::NewFeature also yielding "NewFeature".
Explicitly matching on the Unknown variant should
be avoided for two reasons:
- The inner data
UnknownVariantValueis 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
Dotnet6
Dotnet8
Dotnetcore10
Dotnetcore20
Dotnetcore21
Dotnetcore31
Go1x
Java11
Java17
Java21
Java8
Java8al2
Nodejs
Nodejs10x
Nodejs12x
Nodejs14x
Nodejs16x
Nodejs18x
Nodejs20x
Nodejs43
Nodejs43edge
Nodejs610
Nodejs810
Provided
Providedal2
Providedal2023
Python27
Python310
Python311
Python312
Python36
Python37
Python38
Python39
Ruby25
Ruby27
Ruby32
Ruby33
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§
Trait Implementations§
source§impl Ord for Runtime
impl Ord for Runtime
source§impl PartialOrd for Runtime
impl PartialOrd for Runtime
impl Eq for Runtime
impl StructuralPartialEq for Runtime
Auto Trait Implementations§
impl Freeze for Runtime
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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