pub trait Fallible {
type Output;
// Required method
fn into_result(self) -> Result<Self::Output, Error>;
}
Required Associated Types§
Required Methods§
fn into_result(self) -> Result<Self::Output, Error>
Implementations on Foreign Types§
source§impl Fallible for u64
impl Fallible for u64
source§fn into_result(self) -> Result<<u64 as Fallible>::Output, Error>
fn into_result(self) -> Result<<u64 as Fallible>::Output, Error>
Converts a u64 to a Result by checking for u64::MAX.
If a method that returns an unsigned int is fallible, then the -1 error result wraps around to u64::MAX.
For a u64 to be Fallible, a result of u64::MAX must not be
possible without an error. For example, s2n_connection_get_delay
can’t return u64::MAX as a valid result because
s2n-tls blinding delays are limited to 30s, or a return value of 3^10 ns,
which is significantly less than u64::MAX. s2n_connection_get_delay
would therefore only return u64::MAX for a -1 error result.