cranelift_entity

Trait Unsigned

Source
pub trait Unsigned {
    type Unsigned;

    // Required method
    fn unsigned(self) -> Self::Unsigned;
}
Expand description

Helper trait used to add unsigned() methods to primitive signed integer types.

The purpose of this trait is to signal the intent that the sign bit of a signed integer is intended to be discarded and the value is instead understood to be a “bag of bits” where the conversion to an unsigned number is intended to be lossless. This can be used for example when converting a signed integer into a larger width with zero-extension.

Required Associated Types§

Source

type Unsigned

The unsigned integer for this type which has the same width.

Required Methods§

Source

fn unsigned(self) -> Self::Unsigned

View this signed integer as an unsigned integer of the same width.

All bits are preserved.

Implementations on Foreign Types§

Source§

impl Unsigned for i8

Source§

impl Unsigned for i16

Source§

impl Unsigned for i32

Source§

impl Unsigned for i64

Source§

impl Unsigned for i128

Source§

impl Unsigned for isize

Implementors§