#[non_exhaustive]pub struct ErrorEnvelope {
pub wire_code: &'static str,
pub wire_class: ErrorClass,
pub retry_after_secs: Option<u64>,
pub provider_status: Option<u16>,
}Expand description
Typed wire shape of an Error — the canonical inspector at
sink / SSE / audit boundaries. Built by Error::envelope; never
constructed externally so the field set evolves under the same
patch-version-stability guarantee as wire_code itself.
Copy is intentional: every field is 16 bytes or smaller. Carry
the envelope by value through sink fan-out, OTel attribute
stamping, and SSE serialisation without .clone() ceremony.
§Field semantics
wire_code— patch-version-stable snake-case&'static strbucketing the error onto an i18n / metric / typed-wire key. HTTP provider failures bucket on the status family so vendor drift does not require an SDK release.wire_class— coarse responsibility split.Clientfor caller-actionable failures,Serverfor SDK/vendor-side failures. Orthogonal to retry semantics.retry_after_secs— vendorRetry-Afterhint converted to whole seconds when the originatingError::Providercaptured one.Nonefor every other variant or for Provider errors that arrived without a hint. Sinks key SSE rate-limit timers / FE retry indicators off this field.provider_status— raw HTTP status when the error isProviderwithProviderErrorKind::Http;Noneotherwise. Lets audit / replay retain429 vs 503granularity even thoughwire_codecollapses them onto coarse buckets.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.wire_code: &'static strPatch-version-stable wire code. See type-level doc.
wire_class: ErrorClassResponsibility class. See type-level doc.
retry_after_secs: Option<u64>Vendor Retry-After hint in seconds. See type-level doc.
provider_status: Option<u16>Raw HTTP status for Provider/Http failures. See type-level doc.
Trait Implementations§
Source§impl Clone for ErrorEnvelope
impl Clone for ErrorEnvelope
Source§fn clone(&self) -> ErrorEnvelope
fn clone(&self) -> ErrorEnvelope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorEnvelope
impl Debug for ErrorEnvelope
Source§impl Hash for ErrorEnvelope
impl Hash for ErrorEnvelope
Source§impl PartialEq for ErrorEnvelope
impl PartialEq for ErrorEnvelope
Source§fn eq(&self, other: &ErrorEnvelope) -> bool
fn eq(&self, other: &ErrorEnvelope) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ErrorEnvelope
impl Serialize for ErrorEnvelope
impl Copy for ErrorEnvelope
impl Eq for ErrorEnvelope
impl StructuralPartialEq for ErrorEnvelope
Auto Trait Implementations§
impl Freeze for ErrorEnvelope
impl RefUnwindSafe for ErrorEnvelope
impl Send for ErrorEnvelope
impl Sync for ErrorEnvelope
impl Unpin for ErrorEnvelope
impl UnsafeUnpin for ErrorEnvelope
impl UnwindSafe for ErrorEnvelope
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.