wasmtime_environ

Trait Unsigned

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§

type Unsigned

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

Required Methods§

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§

§

impl Unsigned for i8

§

type Unsigned = u8

§

fn unsigned(self) -> u8

§

impl Unsigned for i16

§

type Unsigned = u16

§

fn unsigned(self) -> u16

§

impl Unsigned for i32

§

type Unsigned = u32

§

fn unsigned(self) -> u32

§

impl Unsigned for i64

§

type Unsigned = u64

§

fn unsigned(self) -> u64

§

impl Unsigned for i128

§

type Unsigned = u128

§

fn unsigned(self) -> u128

§

impl Unsigned for isize

§

type Unsigned = usize

§

fn unsigned(self) -> usize

Implementors§