Signed

Trait Signed 

Source
pub trait Signed {
    type Signed;
    type Unsigned;

    // Required methods
    fn as_unsigned(self) -> Self::Unsigned;
    fn as_signed(self) -> Self::Signed;
    fn abs_unsigned(self) -> Self::Unsigned;
}
Expand description

Types with signed and unsigned variants

Note that references don’t currently implement this trait due to lack of GATs, which are required to specify that a &'a u8 may be cast to a &'a i8 with the same lifetime.

Required Associated Types§

Source

type Signed

Signed variant of this type

Source

type Unsigned

Unsigned variant of this type

Required Methods§

Source

fn as_unsigned(self) -> Self::Unsigned

Reinterprets this value as unsigned

Source

fn as_signed(self) -> Self::Signed

Reinterprets this value as signed

Source

fn abs_unsigned(self) -> Self::Unsigned

Returns the absolute value of self as unsigned.

Implementations on Foreign Types§

Source§

impl Signed for i8

Source§

impl Signed for i16

Source§

impl Signed for i32

Source§

impl Signed for i64

Source§

impl Signed for i128

Source§

impl Signed for isize

Source§

impl Signed for u8

Source§

impl Signed for u16

Source§

impl Signed for u32

Source§

impl Signed for u64

Source§

impl Signed for u128

Source§

impl Signed for usize

Implementors§