#[non_exhaustive]pub struct DecodeFailure<E> {
pub topic: Arc<TopicMatch>,
pub meta: Arc<MessageMeta>,
pub error: E,
}Expand description
A message arrived but its payload could not be deserialized. Carries the same
context as IncomingMessage so a handler can still see which topic (and
with what metadata) failed. The stream continues after this event.
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.topic: Arc<TopicMatch>The concrete topic the undecodable message arrived on.
meta: Arc<MessageMeta>Per-message protocol metadata of the undecodable message.
error: EThe deserialization error.
Implementations§
Source§impl<E> DecodeFailure<E>
impl<E> DecodeFailure<E>
Sourcepub fn new(
topic: Arc<TopicMatch>,
meta: Arc<MessageMeta>,
error: E,
) -> DecodeFailure<E>
pub fn new( topic: Arc<TopicMatch>, meta: Arc<MessageMeta>, error: E, ) -> DecodeFailure<E>
Construct a decode failure. Public so downstream tests can build one (the
type is #[non_exhaustive], so a struct literal is not available
off-crate).
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for DecodeFailure<E>where
E: Freeze,
impl<E> RefUnwindSafe for DecodeFailure<E>where
E: RefUnwindSafe,
impl<E> Send for DecodeFailure<E>where
E: Send,
impl<E> Sync for DecodeFailure<E>where
E: Sync,
impl<E> Unpin for DecodeFailure<E>where
E: Unpin,
impl<E> UnsafeUnpin for DecodeFailure<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for DecodeFailure<E>where
E: UnwindSafe,
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