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§