Trait gardiz::bits::CastSigned

source ·
pub trait CastSigned: Unsigned {
    type Target;

    // Required method
    fn cast_signed(&self) -> Self::Target;
}
Expand description

Trait for bit-casts from unsigned integers to 2’s complement signed integers.

Required Associated Types§

source

type Target

Type of the target signed version.

Required Methods§

source

fn cast_signed(&self) -> Self::Target

Bit-casts the given (self) unsigned number into a signed version.

Implementations on Foreign Types§

source§

impl CastSigned for u64

§

type Target = i64

source§

fn cast_signed(&self) -> Self::Target

source§

impl CastSigned for u128

§

type Target = i128

source§

fn cast_signed(&self) -> Self::Target

source§

impl CastSigned for u16

§

type Target = i16

source§

fn cast_signed(&self) -> Self::Target

source§

impl CastSigned for u8

§

type Target = i8

source§

fn cast_signed(&self) -> Self::Target

source§

impl CastSigned for u32

§

type Target = i32

source§

fn cast_signed(&self) -> Self::Target

source§

impl CastSigned for usize

§

type Target = isize

source§

fn cast_signed(&self) -> Self::Target

Implementors§

source§

impl<T> CastSigned for Vec2<T>where T: CastSigned,

§

type Target = Vec2<<T as CastSigned>::Target>