Skip to main content

NativeCast

Trait NativeCast 

Source
pub trait NativeCast: Portable + Copy {
    type Native: Copy;

    // Required methods
    fn from_native(n: Self::Native) -> Self;
    fn to_native(&self) -> Self::Native;
}
Expand description

Trait for casting portable type to/from native counterparts.

Required Associated Types§

Required Methods§

Source

fn from_native(n: Self::Native) -> Self

Source

fn to_native(&self) -> Self::Native

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl NativeCast for i8

Source§

type Native = i8

Source§

fn from_native(n: i8) -> Self

Source§

fn to_native(&self) -> i8

Source§

impl NativeCast for u8

Source§

type Native = u8

Source§

fn from_native(n: u8) -> Self

Source§

fn to_native(&self) -> u8

Implementors§

Source§

impl NativeCast for Bool

Source§

impl NativeCast for Float<false, 4>

Source§

impl NativeCast for Float<false, 8>

Source§

impl NativeCast for Float<true, 4>

Source§

impl NativeCast for Float<true, 8>

Source§

impl NativeCast for Int<false, 2, false>

Source§

impl NativeCast for Int<false, 2, true>

Source§

impl NativeCast for Int<false, 4, false>

Source§

impl NativeCast for Int<false, 4, true>

Source§

impl NativeCast for Int<false, 8, false>

Source§

impl NativeCast for Int<false, 8, true>

Source§

impl NativeCast for Int<true, 2, false>

Source§

impl NativeCast for Int<true, 2, true>

Source§

impl NativeCast for Int<true, 4, false>

Source§

impl NativeCast for Int<true, 4, true>

Source§

impl NativeCast for Int<true, 8, false>

Source§

impl NativeCast for Int<true, 8, true>