[][src]Enum peepmatic_runtime::part::Constant

pub enum Constant {
    Bool(boolBitWidth),
    Int(u64BitWidth),
}

A constant value.

Whether an integer is interpreted as signed or unsigned depends on the operations applied to it.

Variants

Bool(boolBitWidth)

A boolean of the given width.

Int(u64BitWidth)

An integer constant of the given width,

Implementations

impl Constant[src]

pub fn as_int(&self) -> Option<u64>[src]

If this is any kind of integer constant, get it as a 64-bit unsigned integer.

pub fn as_bool(&self) -> Option<bool>[src]

If this is any kind of boolean constant, get its value.

pub fn bit_width(&self, root_width: u8) -> u8[src]

The number of bits required to represent this constant value's type.

Trait Implementations

impl Clone for Constant[src]

impl Copy for Constant[src]

impl Debug for Constant[src]

impl Eq for Constant[src]

impl<I> From<Constant> for Part<I> where
    I: Copy + Debug + Eq
[src]

impl PartialEq<Constant> for Constant[src]

impl StructuralEq for Constant[src]

impl StructuralPartialEq for Constant[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.