#[repr(u8)]pub enum NumericWidth {
I8 = 0,
I16 = 1,
I32 = 2,
I64 = 3,
U8 = 4,
U16 = 5,
U32 = 6,
U64 = 7,
F32 = 8,
F64 = 9,
}Expand description
Numeric width tag for compact typed opcodes (AddTyped, SubTyped, etc.).
Encodes the operand width so a single opcode family can handle all numeric types. The discriminant values are part of the bytecode ABI and must remain stable.
Variants§
Implementations§
Source§impl NumericWidth
impl NumericWidth
pub const ALL: [Self; 10]
pub const fn is_integer(self) -> bool
pub const fn is_float(self) -> bool
Sourcepub const fn is_unsigned(self) -> bool
pub const fn is_unsigned(self) -> bool
Whether this is an unsigned integer type.
Sourcepub fn from_int_width(w: IntWidth) -> Self
pub fn from_int_width(w: IntWidth) -> Self
Convert from IntWidth (shape-ast) to NumericWidth.
Sourcepub fn to_int_width(self) -> Option<IntWidth>
pub fn to_int_width(self) -> Option<IntWidth>
Convert to IntWidth (shape-ast). Returns None for F32/F64/I64.
Trait Implementations§
Source§impl Clone for NumericWidth
impl Clone for NumericWidth
Source§fn clone(&self) -> NumericWidth
fn clone(&self) -> NumericWidth
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NumericWidth
impl Debug for NumericWidth
Source§impl<'de> Deserialize<'de> for NumericWidth
impl<'de> Deserialize<'de> for NumericWidth
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for NumericWidth
impl PartialEq for NumericWidth
Source§impl Serialize for NumericWidth
impl Serialize for NumericWidth
impl Copy for NumericWidth
impl Eq for NumericWidth
impl StructuralPartialEq for NumericWidth
Auto Trait Implementations§
impl Freeze for NumericWidth
impl RefUnwindSafe for NumericWidth
impl Send for NumericWidth
impl Sync for NumericWidth
impl Unpin for NumericWidth
impl UnsafeUnpin for NumericWidth
impl UnwindSafe for NumericWidth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more