#[non_exhaustive]pub enum PayloadHint {
Unknown,
NoStructPayload,
StructPayload,
}Expand description
Whether a structure has an @httpPayload member that supplies its own body
framing, ex: a member carrying @httpPayload whose target is a
structure or a union.
§Why this is a hint and not a fact
The HTTP binding protocol needs this answer on every request, and deriving it means scanning the input schema’s members. Codegen already knows the answer, so it records it here and the runtime reads it instead of scanning.
Unknown is the default, and the runtime falls back
to scanning when it sees it. That fallback is permanent, not
transitional. Two callers rely on it:
- schemas constructed by hand or materialized at runtime, which have no codegen step to set the hint;
- generated crates produced before codegen began emitting the hint, which
Cargo permits to link against a newer
aws-smithy-schemawithin the same major version.
So this value must never become load-bearing for correctness. Anything that
consumes it has to produce identical output for Unknown by deriving the
answer itself.
§Why the framing question rather than the payload’s shape
The variants deliberately answer “does a payload member frame the body?”
rather than describing the payload’s type. @httpPayload may also target a
blob, string, or document, and those are not grouped together by the
runtime: blob and string payloads bypass the codec entirely (their bytes
become the body verbatim), while a document payload is written through the
codec. A variant named for one of those groupings would either be wrong or
would have to change meaning if a consumer for the distinction appeared.
The enum is #[non_exhaustive], so a finer classification can be added
later without a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unknown
Not recorded. Consumers must derive the answer themselves.
This is the default for every schema, including every hand-constructed one.
NoStructPayload
No member carries @httpPayload targeting a structure or union.
Body framing, if any, comes from the codec.
StructPayload
A member carries @httpPayload targeting a structure or union.
That member writes its own framing, so the codec must not add top-level framing around it.
Trait Implementations§
Source§impl Clone for PayloadHint
impl Clone for PayloadHint
Source§fn clone(&self) -> PayloadHint
fn clone(&self) -> PayloadHint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PayloadHint
impl Debug for PayloadHint
Source§impl Default for PayloadHint
impl Default for PayloadHint
Source§fn default() -> PayloadHint
fn default() -> PayloadHint
Source§impl Hash for PayloadHint
impl Hash for PayloadHint
Source§impl PartialEq for PayloadHint
impl PartialEq for PayloadHint
impl Copy for PayloadHint
impl Eq for PayloadHint
impl StructuralPartialEq for PayloadHint
Auto Trait Implementations§
impl Freeze for PayloadHint
impl RefUnwindSafe for PayloadHint
impl Send for PayloadHint
impl Sync for PayloadHint
impl Unpin for PayloadHint
impl UnsafeUnpin for PayloadHint
impl UnwindSafe for PayloadHint
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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