pub struct TrajectoryErrorMessage(/* private fields */);Expand description
Capped error-message payload for TrajectoryOutcome::Error.
Wraps a String that has been truncated to
TrajectoryErrorMessage::MAX_BYTES. Cow<'static, str> (the
previous shape) made err.to_string().into() look harmless even
though the full Display form can carry many KiB of context —
every event then balloons the size of the flow-log sinks. Constrain
the type so a caller can’t accidentally bypass the cap.
Construction:
From<&Error>— the production path: routes the message throughSerializedError::from, inheriting its byte cap.from_static(&'static str)— convenience for tests / fixtures.from_truncated(String)— explicit cap on an already-built string; useful when the caller already has a message they don’t want to re-wrap.
Implementations§
Source§impl TrajectoryErrorMessage
impl TrajectoryErrorMessage
Sourcepub const MAX_BYTES: usize = crate::error::SERIALIZED_MESSAGE_CAP
pub const MAX_BYTES: usize = crate::error::SERIALIZED_MESSAGE_CAP
Hard cap on the rendered message. Matches the
SerializedError::message ceiling so the two carriers stay in
lock-step; anything beyond this is truncated with a
… [truncated] suffix.
Sourcepub fn from_static(s: &'static str) -> Self
pub fn from_static(s: &'static str) -> Self
Build from a static string slice. No truncation needed at the type level — call sites that exceed the cap are caller-error.
Sourcepub fn from_truncated(s: String) -> Self
pub fn from_truncated(s: String) -> Self
Cap an already-built String to Self::MAX_BYTES.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl Clone for TrajectoryErrorMessage
impl Clone for TrajectoryErrorMessage
Source§fn clone(&self) -> TrajectoryErrorMessage
fn clone(&self) -> TrajectoryErrorMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TrajectoryErrorMessage
impl Debug for TrajectoryErrorMessage
Source§impl<'de> Deserialize<'de> for TrajectoryErrorMessage
impl<'de> Deserialize<'de> for TrajectoryErrorMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&Error> for TrajectoryErrorMessage
impl From<&Error> for TrajectoryErrorMessage
Source§impl PartialEq for TrajectoryErrorMessage
impl PartialEq for TrajectoryErrorMessage
Source§fn eq(&self, other: &TrajectoryErrorMessage) -> bool
fn eq(&self, other: &TrajectoryErrorMessage) -> bool
self and other values to be equal, and is used by ==.