pub enum Infallible {}
Expand description
The error type for errors that can never happen.
Since this enum has no variant, a value of this type can never actually exist.
This can be useful for generic APIs that use Result
and parameterize the error type,
to indicate that the result is always Ok
.
For example, the TryFrom
trait (conversion that returns a Result
)
has a blanket implementation for all types where a reverse Into
implementation exists.
ⓘ
impl<T, U> TryFrom<U> for T where U: Into<T> {
type Error = Infallible;
fn try_from(value: U) ->