pub struct Value { /* private fields */ }Expand description
§A unit of data
StackAssembly is an untyped languages. All of its values, both on the
OperandStack and in Memory, are 32 bits wide. Depending on the
situation, they may be interpreted as unsigned or signed.
You can create an instance of Value through its From implementations.
use stack_assembly::Value;
Value::from(3i32);
Value::from(5u32);Implementations§
Source§impl Value
impl Value
Sourcepub fn to_i32(self) -> i32
pub fn to_i32(self) -> i32
§Convert the value to an i32
Since all values are 32 bits wide, this is always possible. Interprets the bits of the value as a signed (two’s complement) integer.
Trait Implementations§
impl Copy for Value
impl Eq for Value
impl Pod for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.