Trait cast::From

source ·
pub trait From<Src> {
    type Output;

    // Required method
    fn cast(_: Src) -> Self::Output;
}
Expand description

The “cast from” operation

Required Associated Types§

source

type Output

The result of the cast operation: either Self or Result<Self, Error>

Required Methods§

source

fn cast(_: Src) -> Self::Output

Checked cast from Src to Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl From<f32> for f32

§

type Output = f32

source§

fn cast(src: f32) -> f32

source§

impl From<f32> for f64

§

type Output = f64

source§

fn cast(src: f32) -> f64

source§

impl From<f32> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f32> for i16

§

type Output = Result<i16, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f32> for i32

§

type Output = Result<i32, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f32> for i64

§

type Output = Result<i64, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f32> for isize

§

type Output = Result<isize, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f32> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f32> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f32> for u32

§

type Output = Result<u32, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f32> for u64

§

type Output = Result<u64, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f32> for usize

§

type Output = Result<usize, Error>

source§

fn cast(src: f32) -> Self::Output

source§

impl From<f64> for f32

§

type Output = Result<f32, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for f64

§

type Output = f64

source§

fn cast(src: f64) -> f64

source§

impl From<f64> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for i16

§

type Output = Result<i16, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for i32

§

type Output = Result<i32, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for i64

§

type Output = Result<i64, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for isize

§

type Output = Result<isize, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for u32

§

type Output = Result<u32, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for u64

§

type Output = Result<u64, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<f64> for usize

§

type Output = Result<usize, Error>

source§

fn cast(src: f64) -> Self::Output

source§

impl From<i8> for f32

§

type Output = f32

source§

fn cast(src: i8) -> f32

source§

impl From<i8> for f64

§

type Output = f64

source§

fn cast(src: i8) -> f64

source§

impl From<i8> for i8

§

type Output = i8

source§

fn cast(src: i8) -> i8

source§

impl From<i8> for i16

§

type Output = i16

source§

fn cast(src: i8) -> i16

source§

impl From<i8> for i32

§

type Output = i32

source§

fn cast(src: i8) -> i32

source§

impl From<i8> for i64

§

type Output = i64

source§

fn cast(src: i8) -> i64

source§

impl From<i8> for isize

§

type Output = isize

source§

fn cast(src: i8) -> isize

source§

impl From<i8> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: i8) -> Self::Output

source§

impl From<i8> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: i8) -> Self::Output

source§

impl From<i8> for u32

§

type Output = Result<u32, Error>

source§

fn cast(src: i8) -> Self::Output

source§

impl From<i8> for u64

§

type Output = Result<u64, Error>

source§

fn cast(src: i8) -> Self::Output

source§

impl From<i8> for usize

§

type Output = Result<usize, Error>

source§

fn cast(src: i8) -> Self::Output

source§

impl From<i16> for f32

§

type Output = f32

source§

fn cast(src: i16) -> f32

source§

impl From<i16> for f64

§

type Output = f64

source§

fn cast(src: i16) -> f64

source§

impl From<i16> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: i16) -> Self::Output

source§

impl From<i16> for i16

§

type Output = i16

source§

fn cast(src: i16) -> i16

source§

impl From<i16> for i32

§

type Output = i32

source§

fn cast(src: i16) -> i32

source§

impl From<i16> for i64

§

type Output = i64

source§

fn cast(src: i16) -> i64

source§

impl From<i16> for isize

§

type Output = isize

source§

fn cast(src: i16) -> isize

source§

impl From<i16> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: i16) -> Self::Output

source§

impl From<i16> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: i16) -> Self::Output

source§

impl From<i16> for u32

§

type Output = Result<u32, Error>

source§

fn cast(src: i16) -> Self::Output

source§

impl From<i16> for u64

§

type Output = Result<u64, Error>

source§

fn cast(src: i16) -> Self::Output

source§

impl From<i16> for usize

§

type Output = Result<usize, Error>

source§

fn cast(src: i16) -> Self::Output

source§

impl From<i32> for f32

§

type Output = f32

source§

fn cast(src: i32) -> f32

source§

impl From<i32> for f64

§

type Output = f64

source§

fn cast(src: i32) -> f64

source§

impl From<i32> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: i32) -> Self::Output

source§

impl From<i32> for i16

§

type Output = Result<i16, Error>

source§

fn cast(src: i32) -> Self::Output

source§

impl From<i32> for i32

§

type Output = i32

source§

fn cast(src: i32) -> i32

source§

impl From<i32> for i64

§

type Output = i64

source§

fn cast(src: i32) -> i64

source§

impl From<i32> for isize

§

type Output = isize

source§

fn cast(src: i32) -> isize

source§

impl From<i32> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: i32) -> Self::Output

source§

impl From<i32> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: i32) -> Self::Output

source§

impl From<i32> for u32

§

type Output = Result<u32, Error>

source§

fn cast(src: i32) -> Self::Output

source§

impl From<i32> for u64

§

type Output = Result<u64, Error>

source§

fn cast(src: i32) -> Self::Output

source§

impl From<i32> for usize

§

type Output = Result<usize, Error>

source§

fn cast(src: i32) -> Self::Output

source§

impl From<i64> for f32

§

type Output = f32

source§

fn cast(src: i64) -> f32

source§

impl From<i64> for f64

§

type Output = f64

source§

fn cast(src: i64) -> f64

source§

impl From<i64> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: i64) -> Self::Output

source§

impl From<i64> for i16

§

type Output = Result<i16, Error>

source§

fn cast(src: i64) -> Self::Output

source§

impl From<i64> for i32

§

type Output = Result<i32, Error>

source§

fn cast(src: i64) -> Self::Output

source§

impl From<i64> for i64

§

type Output = i64

source§

fn cast(src: i64) -> i64

source§

impl From<i64> for isize

§

type Output = isize

source§

fn cast(src: i64) -> isize

source§

impl From<i64> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: i64) -> Self::Output

source§

impl From<i64> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: i64) -> Self::Output

source§

impl From<i64> for u32

§

type Output = Result<u32, Error>

source§

fn cast(src: i64) -> Self::Output

source§

impl From<i64> for u64

§

type Output = Result<u64, Error>

source§

fn cast(src: i64) -> Self::Output

source§

impl From<i64> for usize

§

type Output = Result<usize, Error>

source§

fn cast(src: i64) -> Self::Output

source§

impl From<isize> for f32

§

type Output = f32

source§

fn cast(src: isize) -> f32

source§

impl From<isize> for f64

§

type Output = f64

source§

fn cast(src: isize) -> f64

source§

impl From<isize> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: isize) -> Self::Output

source§

impl From<isize> for i16

§

type Output = Result<i16, Error>

source§

fn cast(src: isize) -> Self::Output

source§

impl From<isize> for i32

§

type Output = Result<i32, Error>

source§

fn cast(src: isize) -> Self::Output

source§

impl From<isize> for i64

§

type Output = i64

source§

fn cast(src: isize) -> i64

source§

impl From<isize> for isize

source§

impl From<isize> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: isize) -> Self::Output

source§

impl From<isize> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: isize) -> Self::Output

source§

impl From<isize> for u32

§

type Output = Result<u32, Error>

source§

fn cast(src: isize) -> Self::Output

source§

impl From<isize> for u64

§

type Output = Result<u64, Error>

source§

fn cast(src: isize) -> Self::Output

source§

impl From<isize> for usize

§

type Output = Result<usize, Error>

source§

fn cast(src: isize) -> Self::Output

source§

impl From<u8> for f32

§

type Output = f32

source§

fn cast(src: u8) -> f32

source§

impl From<u8> for f64

§

type Output = f64

source§

fn cast(src: u8) -> f64

source§

impl From<u8> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: u8) -> Self::Output

source§

impl From<u8> for i16

§

type Output = i16

source§

fn cast(src: u8) -> i16

source§

impl From<u8> for i32

§

type Output = i32

source§

fn cast(src: u8) -> i32

source§

impl From<u8> for i64

§

type Output = i64

source§

fn cast(src: u8) -> i64

source§

impl From<u8> for isize

§

type Output = isize

source§

fn cast(src: u8) -> isize

source§

impl From<u8> for u8

§

type Output = u8

source§

fn cast(src: u8) -> u8

source§

impl From<u8> for u16

§

type Output = u16

source§

fn cast(src: u8) -> u16

source§

impl From<u8> for u32

§

type Output = u32

source§

fn cast(src: u8) -> u32

source§

impl From<u8> for u64

§

type Output = u64

source§

fn cast(src: u8) -> u64

source§

impl From<u8> for usize

§

type Output = usize

source§

fn cast(src: u8) -> usize

source§

impl From<u16> for f32

§

type Output = f32

source§

fn cast(src: u16) -> f32

source§

impl From<u16> for f64

§

type Output = f64

source§

fn cast(src: u16) -> f64

source§

impl From<u16> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: u16) -> Self::Output

source§

impl From<u16> for i16

§

type Output = Result<i16, Error>

source§

fn cast(src: u16) -> Self::Output

source§

impl From<u16> for i32

§

type Output = i32

source§

fn cast(src: u16) -> i32

source§

impl From<u16> for i64

§

type Output = i64

source§

fn cast(src: u16) -> i64

source§

impl From<u16> for isize

§

type Output = isize

source§

fn cast(src: u16) -> isize

source§

impl From<u16> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: u16) -> Self::Output

source§

impl From<u16> for u16

§

type Output = u16

source§

fn cast(src: u16) -> u16

source§

impl From<u16> for u32

§

type Output = u32

source§

fn cast(src: u16) -> u32

source§

impl From<u16> for u64

§

type Output = u64

source§

fn cast(src: u16) -> u64

source§

impl From<u16> for usize

§

type Output = usize

source§

fn cast(src: u16) -> usize

source§

impl From<u32> for f32

§

type Output = f32

source§

fn cast(src: u32) -> f32

source§

impl From<u32> for f64

§

type Output = f64

source§

fn cast(src: u32) -> f64

source§

impl From<u32> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: u32) -> Self::Output

source§

impl From<u32> for i16

§

type Output = Result<i16, Error>

source§

fn cast(src: u32) -> Self::Output

source§

impl From<u32> for i32

§

type Output = Result<i32, Error>

source§

fn cast(src: u32) -> Self::Output

source§

impl From<u32> for i64

§

type Output = i64

source§

fn cast(src: u32) -> i64

source§

impl From<u32> for isize

§

type Output = isize

source§

fn cast(src: u32) -> isize

source§

impl From<u32> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: u32) -> Self::Output

source§

impl From<u32> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: u32) -> Self::Output

source§

impl From<u32> for u32

§

type Output = u32

source§

fn cast(src: u32) -> u32

source§

impl From<u32> for u64

§

type Output = u64

source§

fn cast(src: u32) -> u64

source§

impl From<u32> for usize

§

type Output = usize

source§

fn cast(src: u32) -> usize

source§

impl From<u64> for f32

§

type Output = f32

source§

fn cast(src: u64) -> f32

source§

impl From<u64> for f64

§

type Output = f64

source§

fn cast(src: u64) -> f64

source§

impl From<u64> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: u64) -> Self::Output

source§

impl From<u64> for i16

§

type Output = Result<i16, Error>

source§

fn cast(src: u64) -> Self::Output

source§

impl From<u64> for i32

§

type Output = Result<i32, Error>

source§

fn cast(src: u64) -> Self::Output

source§

impl From<u64> for i64

§

type Output = Result<i64, Error>

source§

fn cast(src: u64) -> Self::Output

source§

impl From<u64> for isize

§

type Output = Result<isize, Error>

source§

fn cast(src: u64) -> Self::Output

source§

impl From<u64> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: u64) -> Self::Output

source§

impl From<u64> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: u64) -> Self::Output

source§

impl From<u64> for u32

§

type Output = Result<u32, Error>

source§

fn cast(src: u64) -> Self::Output

source§

impl From<u64> for u64

§

type Output = u64

source§

fn cast(src: u64) -> u64

source§

impl From<u64> for usize

§

type Output = usize

source§

fn cast(src: u64) -> usize

source§

impl From<usize> for f32

§

type Output = f32

source§

fn cast(src: usize) -> f32

source§

impl From<usize> for f64

§

type Output = f64

source§

fn cast(src: usize) -> f64

source§

impl From<usize> for i8

§

type Output = Result<i8, Error>

source§

fn cast(src: usize) -> Self::Output

source§

impl From<usize> for i16

§

type Output = Result<i16, Error>

source§

fn cast(src: usize) -> Self::Output

source§

impl From<usize> for i32

§

type Output = Result<i32, Error>

source§

fn cast(src: usize) -> Self::Output

source§

impl From<usize> for i64

§

type Output = Result<i64, Error>

source§

fn cast(src: usize) -> Self::Output

source§

impl From<usize> for isize

§

type Output = Result<isize, Error>

source§

fn cast(src: usize) -> Self::Output

source§

impl From<usize> for u8

§

type Output = Result<u8, Error>

source§

fn cast(src: usize) -> Self::Output

source§

impl From<usize> for u16

§

type Output = Result<u16, Error>

source§

fn cast(src: usize) -> Self::Output

source§

impl From<usize> for u32

§

type Output = Result<u32, Error>

source§

fn cast(src: usize) -> Self::Output

source§

impl From<usize> for u64

§

type Output = u64

source§

fn cast(src: usize) -> u64

source§

impl From<usize> for usize

Implementors§