pub enum HookState {
Disabled,
Enabled,
}Expand description
HookState, the model’s two values.
§A typed enum rather than a validated String, and why this one and not the response states
This is the same trade VersionStatus makes and the reasoning is the same shape. A
response enum must stay a String — a third value AWS adds has to parse rather than fail,
which is what MicrovmImageBuildSummaryWire::architecture documents. HookState on the
request side is only ever serialized, so narrowing it costs nothing and buys the thing a
two-value enum buys: "ENABLE", "Enabled", and "ACTIVE" become compile errors instead of
a ValidationException.
It is worth more here than on any other member, because it appears six times on one
request. Issue #24 measured what was there before: six String fields with "ENABLED"
hardcoded as a const &str local to hooks_block, so no constant named either value and a
typo in one of the six was a rejected CreateMicrovmImage — after the artifact upload.
§Deserialize too, unlike VersionStatus
Because a MicrovmHooks block is a request shape in this module and the tests parse
model-spelled JSON into it (the honest-fake rule). Deriving Deserialize on a two-variant
enum means an unknown state fails that parse, which is correct for a shape nothing reads off
a real response — and MicrovmImageVersionSummaryWire deliberately does not read a hooks
block at all, for measured reasons that type records.
Variants§
Disabled
The platform does not call this hook.
Enabled
The platform calls this hook and waits for it. What this client always sends.
Implementations§
Trait Implementations§
impl Copy for HookState
Source§impl<'de> Deserialize<'de> for HookState
impl<'de> Deserialize<'de> for HookState
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HookState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HookState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for HookState
Source§impl Serialize for HookState
impl Serialize for HookState
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for HookState
Auto Trait Implementations§
impl Freeze for HookState
impl RefUnwindSafe for HookState
impl Send for HookState
impl Sync for HookState
impl Unpin for HookState
impl UnsafeUnpin for HookState
impl UnwindSafe for HookState
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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