pub struct Infallible(/* private fields */);Expand description
serde::Serialize-carrying wrapper around core::convert::Infallible.
Recommended choice for Service::ReplyError and Service::ReplyStreamError when the
corresponding methods cannot fail. The service macro also picks it for
Service::ReplyStreamError when no streaming method declares an error type.
It exists because of serde-rs/serde#2740: core::convert::Infallible has no Serialize
impl in serde, which makes it unusable for trait associated types bounded by Serialize.
This wrapper carries the missing impl. The inner core::convert::Infallible cannot be
constructed, so neither can this — the Serialize impl is statically unreachable.
Once serde lands a built-in Serialize impl for Infallible, this wrapper will be
deprecated in favor of core::convert::Infallible.