pub(crate) trait TryIntoUSize: TryInto<usize> {
// Provided method
fn try_to_usize(self) -> Result<usize, ParseError> { ... }
}
Expand description
Wrapper around TryInto that produces a ParseError.
This trait shortens x.try_into().or(Err(ParseError::ConversionFailed))
to x.try_to_usize()
.
Provided Methods§
Sourcefn try_to_usize(self) -> Result<usize, ParseError>
fn try_to_usize(self) -> Result<usize, ParseError>
Attempt the conversion
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.