pub enum Never {}Expand description
An uninhabited type that implements Serialize + DeserializeOwned.
This type has no variants and can never be constructed at runtime,
making it semantically identical to std::convert::Infallible.
Unlike Infallible, Never satisfies the Serialize + DeserializeOwned
bounds required by Axon<In, Out, E, Res>.
§When to Use
- As the error type for infallible pipelines:
Axon<In, Out, Never, Res> - Anywhere an uninhabited type is needed with serde compatibility
§Guarantees
- Cannot be constructed (no variants)
- Serialization: unreachable (no value exists to serialize)
- Deserialization: always fails with a descriptive error
- Converts freely from
std::convert::Infallible
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Never
impl<'de> Deserialize<'de> for Never
Source§fn deserialize<D: Deserializer<'de>>(_deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(_deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Error for Never
impl Error for Never
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Infallible> for Never
impl From<Infallible> for Never
Source§fn from(x: Infallible) -> Self
fn from(x: Infallible) -> Self
Converts to this type from the input type.
impl Copy for Never
impl Eq for Never
impl StructuralPartialEq for Never
Auto Trait Implementations§
impl Freeze for Never
impl RefUnwindSafe for Never
impl Send for Never
impl Sync for Never
impl Unpin for Never
impl UnsafeUnpin for Never
impl UnwindSafe for Never
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§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.