TryFrom in core::convert - Rust
Description: Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal of [`TryInto`].
Keywords: rust, rustlang, rust-lang, TryFrom

# Trait core::convert::TryFrom
1.34.0[−][src]

    pub trait TryFrom<T>: Sized {
        type Error;
        fn try_from(value: T) -> Result<Self, Self::Error>;
    }

Expand description

Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal of `TryInto`.

This is useful when you are doing a type conversion that may trivially succeed but may also need special handling. For example, there is no way to convert an `i64` into an `i32` using the `From` trait, because an `i64` may contain a value that an `i32` cannot represent and so the conversion would lose data. This might be handled by truncating the `i64` to an `i32` (essentially giving the `i64`’s value modulo `i32::MAX`) or by simply returning `i32::MAX`, or by some other method. The `From` trait is intended for perfect conversions, so the `TryFrom` trait informs the programmer when a type conversion could go bad and lets them decide how to handle it.

# Generic Implementations

- `TryFrom<T> for U` implies `TryInto``<U> for T`
- `try_from` is reflexive, which means that `TryFrom<T> for T` is implemented and cannot fail – the associated `Error` type for calling `T::try_from()` on a value of type `T` is `Infallible`. When the `!` type is stabilized `Infallible` and `!` will be equivalent.

`TryFrom<T>` can be implemented as follows:

    use std::convert::TryFrom;

    struct GreaterThanZero(i32);

    impl TryFrom<i32> for GreaterThanZero {
        type Error = &'static str;

        fn try_from(value: i32) -> Result<Self, Self::Error> {
            if value <= 0 {
                Err("GreaterThanZero only accepts value superior than zero!")
            } else {
                Ok(GreaterThanZero(value))
            }
        }
    }

Run

# Examples

As described, `i32` implements `TryFrom<``i64``>`:

    use std::convert::TryFrom;

    let big_number = 1_000_000_000_000i64;
    // Silently truncates `big_number`, requires detecting
    // and handling the truncation after the fact.
    let smaller_number = big_number as i32;
    assert_eq!(smaller_number, -727379968);

    // Returns an error because `big_number` is too big to
    // fit in an `i32`.
    let try_smaller_number = i32::try_from(big_number);
    assert!(try_smaller_number.is_err());

    // Returns `Ok(3)`.
    let try_successful_smaller_number = i32::try_from(3);
    assert!(try_successful_smaller_number.is_ok());

Run

## Associated Types

[src]

#### type Error

The type returned in the event of a conversion error.

## Required methods

[src]

#### fn try_from(value: T) -> Result<Self, Self::Error>

Performs the conversion.

## Implementors

1.49.0[src]

### impl TryFrom<NonZeroI8> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI8> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI8> for NonZeroU32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI8> for NonZeroU64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI8> for NonZeroU128

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI8> for NonZeroUsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI16> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI16> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI16> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI16> for NonZeroU32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI16> for NonZeroU64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI16> for NonZeroU128

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI16> for NonZeroUsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI32> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI32> for NonZeroI16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI32> for NonZeroIsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI32> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI32> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI32> for NonZeroU32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI32> for NonZeroU64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI32> for NonZeroU128

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI32> for NonZeroUsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroI16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroI32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroIsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroU32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroU64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroU128

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI64> for NonZeroUsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroI16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroI32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroI64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroIsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroU32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroU64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroU128

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroI128> for NonZeroUsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroI16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroI32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroI64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroI128

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroU32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroU64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroU128

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroIsize> for NonZeroUsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU8> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU16> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU16> for NonZeroI16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU16> for NonZeroIsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU16> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU32> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU32> for NonZeroI16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU32> for NonZeroI32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU32> for NonZeroIsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU32> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU32> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU32> for NonZeroUsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU64> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU64> for NonZeroI16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU64> for NonZeroI32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU64> for NonZeroI64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU64> for NonZeroIsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU64> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU64> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU64> for NonZeroU32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU64> for NonZeroUsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroI16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroI32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroI64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroI128

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroIsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroU32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroU64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroU128> for NonZeroUsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroI8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroI16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroI32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroI64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroI128

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroIsize

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroU8

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroU16

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroU32

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroU64

#### type Error = TryFromIntError

1.49.0[src]

### impl TryFrom<NonZeroUsize> for NonZeroU128

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<i8> for NonZeroI8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i8> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i8> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i8> for u32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i8> for u64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i8> for u128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i8> for usize

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<i16> for NonZeroI16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i16> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i16> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i16> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i16> for u32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i16> for u64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i16> for u128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i16> for usize

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<i32> for NonZeroI32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i32> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i32> for i16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i32> for isize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i32> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i32> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i32> for u32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i32> for u64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i32> for u128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i32> for usize

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<i64> for NonZeroI64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for i16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for i32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for isize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for u32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for u64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for u128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i64> for usize

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<i128> for NonZeroI128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for i16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for i32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for i64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for isize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for u32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for u64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for u128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<i128> for usize

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<isize> for NonZeroIsize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for i16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for i32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for i64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for i128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for u32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for u64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for u128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<isize> for usize

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<u8> for NonZeroU8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u8> for i8

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<u16> for NonZeroU16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u16> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u16> for i16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u16> for isize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u16> for u8

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<u32> for NonZeroU32

#### type Error = TryFromIntError

[src]

### impl TryFrom<u32> for char

#### type Error = CharTryFromError

1.34.0 (const: unstable)[src]

### impl TryFrom<u32> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u32> for i16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u32> for i32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u32> for isize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u32> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u32> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u32> for usize

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<u64> for NonZeroU64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u64> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u64> for i16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u64> for i32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u64> for i64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u64> for isize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u64> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u64> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u64> for u32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u64> for usize

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<u128> for NonZeroU128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for i16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for i32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for i64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for i128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for isize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for u32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for u64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<u128> for usize

#### type Error = TryFromIntError

1.46.0[src]

### impl TryFrom<usize> for NonZeroUsize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for i8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for i16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for i32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for i64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for i128

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for isize

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for u8

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for u16

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for u32

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for u64

#### type Error = TryFromIntError

1.34.0 (const: unstable)[src]

### impl TryFrom<usize> for u128

#### type Error = TryFromIntError

[src]

### impl<'a, T, const N: usize> TryFrom<&'a [T]> for &'a [T; N]

#### type Error = TryFromSliceError

[src]

### impl<'a, T, const N: usize> TryFrom<&'a mut [T]> for &'a mut [T; N]

#### type Error = TryFromSliceError

[src]

### impl<T, U> TryFrom<U> for T where
U: Into<T>,

#### type Error = Infallible

[src]

### impl<T, const N: usize> TryFrom<&'_ [T]> for [T; N] where
T: Copy,

#### type Error = TryFromSliceError