Struct falcon::il::Constant[][src]

pub struct Constant { /* fields omitted */ }

A constant value for Falcon IL

IL Constants in Falcon are backed by both rust's u64 primitive, and BigUint from the num-bigint crate. This allows modelling and simulation of instructions which must operate on values >64 bits in size. When a Constant has 64 or less bits, the u64 will be used, incurring minimal performance overhead.

The Falcon IL Expression operations are provided as methods over Constant.

Methods

impl Constant
[src]

Create a new Constant with the given value and bitness.

Create a new Constant from the given BigUint.

Crates a constant from a decimal string of the value

Create a new Constant with the given bits and a value of zero

Get the value of this Constant if it is a u64.

Sign-extend the constant out to 64-bits, and return it as an i64

Get the value of this Constant if it is a BigUint.

Get the number of bits for this Constant.

Returns true if the value in this Constant is 0, false otherwise.

Returns true if the value in this constant is 1, false otherwise.

Trait Implementations

impl Clone for Constant
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Constant
[src]

Formats the value using the given formatter. Read more

impl Eq for Constant
[src]

impl Hash for Constant
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Ord for Constant
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialEq for Constant
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for Constant
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Display for Constant
[src]

Formats the value using the given formatter. Read more

impl Into<Expression> for Constant
[src]

Performs the conversion.

impl Value for Constant
[src]

Turn an il::Constant into a representation of this Value

Return the number of bits contained in this value

Shift the value left by the given number of bits

Shift the value right by the given number of bits

Truncate the value to the given number of bits

Zero-extend the value to the given number of bits

Or this value with the given value

Auto Trait Implementations

impl Send for Constant

impl Sync for Constant