[go: up one dir, main page]

Cast

Trait Cast 

Source
pub trait Cast {
    type Output;

    // Required methods
    fn cast_u8(x: [u8; 4]) -> Self::Output;
    fn cast_u16(x: [u16; 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_u8(x: [u8; 4]) -> Self::Output

Cast from u8.

Source

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

Cast from u16.

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.

Implementors§

Source§

impl Cast for U16

Source§

type Output = [u16; 4]