Trait PseudoEncryptable

Source
pub trait PseudoEncryptable: Copy {
    type HalfBitType: Copy;

    const HALF_BIT_SIZE: usize;
    const HALF_BIT_MAX: Self::HalfBitType;

    // Required methods
    fn cast_from_i32(f: i32) -> Self;
    fn cast_from_f32(f: f32) -> Self;
    fn cast_to_f32(f: Self) -> f32;
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn cast_from_i32(f: i32) -> Self

Source

fn cast_from_f32(f: f32) -> Self

Source

fn cast_to_f32(f: Self) -> 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 PseudoEncryptable for i32

Source§

const HALF_BIT_SIZE: usize = 16usize

Source§

const HALF_BIT_MAX: Self::HalfBitType = {transmute(0xffff): <i32 as PseudoEncryptable>::HalfBitType}

Source§

type HalfBitType = u16

Source§

fn cast_from_i32(f: i32) -> Self

Source§

fn cast_from_f32(f: f32) -> Self

Source§

fn cast_to_f32(f: Self) -> f32

Source§

impl PseudoEncryptable for i64

Source§

const HALF_BIT_SIZE: usize = 32usize

Source§

const HALF_BIT_MAX: Self::HalfBitType = {transmute(0xffffffff): <i64 as PseudoEncryptable>::HalfBitType}

Source§

type HalfBitType = u32

Source§

fn cast_from_i32(f: i32) -> Self

Source§

fn cast_from_f32(f: f32) -> Self

Source§

fn cast_to_f32(f: Self) -> f32

Source§

impl PseudoEncryptable for i128

Source§

const HALF_BIT_SIZE: usize = 64usize

Source§

const HALF_BIT_MAX: Self::HalfBitType = {transmute(0xffffffffffffffff): <i128 as PseudoEncryptable>::HalfBitType}

Source§

type HalfBitType = u64

Source§

fn cast_from_i32(f: i32) -> Self

Source§

fn cast_from_f32(f: f32) -> Self

Source§

fn cast_to_f32(f: Self) -> f32

Source§

impl PseudoEncryptable for u32

Source§

const HALF_BIT_SIZE: usize = 16usize

Source§

const HALF_BIT_MAX: Self::HalfBitType = {transmute(0xffff): <u32 as PseudoEncryptable>::HalfBitType}

Source§

type HalfBitType = u16

Source§

fn cast_from_i32(f: i32) -> Self

Source§

fn cast_from_f32(f: f32) -> Self

Source§

fn cast_to_f32(f: Self) -> f32

Source§

impl PseudoEncryptable for u64

Source§

const HALF_BIT_SIZE: usize = 32usize

Source§

const HALF_BIT_MAX: Self::HalfBitType = {transmute(0xffffffff): <u64 as PseudoEncryptable>::HalfBitType}

Source§

type HalfBitType = u32

Source§

fn cast_from_i32(f: i32) -> Self

Source§

fn cast_from_f32(f: f32) -> Self

Source§

fn cast_to_f32(f: Self) -> f32

Source§

impl PseudoEncryptable for u128

Source§

const HALF_BIT_SIZE: usize = 64usize

Source§

const HALF_BIT_MAX: Self::HalfBitType = {transmute(0xffffffffffffffff): <u128 as PseudoEncryptable>::HalfBitType}

Source§

type HalfBitType = u64

Source§

fn cast_from_i32(f: i32) -> Self

Source§

fn cast_from_f32(f: f32) -> Self

Source§

fn cast_to_f32(f: Self) -> f32

Implementors§