[go: up one dir, main page]

Cast

Trait Cast 

Source
pub trait Cast {
    type Output;

    // Required methods
    fn cast_i8(x: [i8; 4]) -> Self::Output;
    fn cast_u8(x: [u8; 4]) -> Self::Output;
    fn cast_i16(x: [i16; 4]) -> Self::Output;
    fn cast_u16(x: [u16; 4]) -> Self::Output;
    fn cast_f32(x: [f32; 4]) -> Self::Output;
}
Available on crate feature utils only.
Expand description

Trait for types which describe casting behaviour.

Required Associated Types§

Source

type Output

Output type.

Required Methods§

Source

fn cast_i8(x: [i8; 4]) -> Self::Output

Cast from i8.

Source

fn cast_u8(x: [u8; 4]) -> Self::Output

Cast from u8.

Source

fn cast_i16(x: [i16; 4]) -> Self::Output

Cast from i16.

Source

fn cast_u16(x: [u16; 4]) -> Self::Output

Cast from u16.

Source

fn cast_f32(x: [f32; 4]) -> Self::Output

Cast from f32.

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.

Implementations on Foreign Types§

Source§

impl Cast for i8

Source§

type Output = [u8; 4]

Source§

fn cast_i8(x: [i8; 4]) -> Self::Output

Source§

fn cast_u8(x: [u8; 4]) -> Self::Output

Source§

fn cast_i16(x: [i16; 4]) -> Self::Output

Source§

fn cast_u16(x: [u16; 4]) -> Self::Output

Source§

fn cast_f32(x: [f32; 4]) -> Self::Output

Implementors§

Source§

impl Cast for F32

Source§

type Output = [f32; 4]

Source§

impl Cast for I8

Source§

type Output = [i8; 4]

Source§

impl Cast for I16

Source§

type Output = [i16; 4]

Source§

impl Cast for U16

Source§

type Output = [u16; 4]