Skip to content
API REFERENCEUsage guides →

cellpack::loader::Conversion ​

enum

Module contract · All interfaces

At a glance ​

#[repr(u8)]pub enum Conversion {
    Same = 0,
    Widen = 1,
    Reinterpret = 2,
    IntToF32 = 3,
    IntToF64 = 4,
    F32ToF64 = 5,
}

Cost classes of conversions, as the cost model prices them.

Fields and variants ​

Same ​

Same = 0

No conversion: the same element type.

Widen ​

Widen = 1

Integer widening (zero or sign extension).

Reinterpret ​

Reinterpret = 2

Same-width signed to unsigned.

IntToF32 ​

IntToF32 = 3

Any integer to f32 (exact up to 2^24).

IntToF64 ​

IntToF64 = 4

Any integer to f64.

F32ToF64 ​

F32ToF64 = 5

f32 to f64.

Member index ​

1 of 1 members

  • ofThe class of the pair s -> t , for every pair allowed accepts. Same-width signed-to-unsigned pairs are reinterpretations, wider pairs widenings.

Methods and associated constants ​

of ​

pub fn of(s: Dtype, t: Dtype) -> Self

The class of the pair s -> t, for every pair allowed accepts. Same-width signed-to-unsigned pairs are reinterpretations, wider pairs widenings.

Implemented traits ​

impl Clone for Conversion
impl Debug for Conversion

Contract reference ​

See the module reference for semantic input/output rules, units, allocation, mutation, failure behavior, and lifetime requirements. Declarations and documented members are synchronized from the crate source.

Definition