[][src]Enum dynasm::Value

pub enum Value {
    Number(Number),
    Expr(Expr),
}

A dynamically or statically computed value.

To produce valid binary it is mostly only important to know the correct width of the output but the value itself can be computed by the caller. This allows freedom on parsing without requiring the assembler core (this library) to implement an arbitrary expression evaluator. In particular, the evaluation can even be further delayed by the caller and left to rustc.

Variants

Number(Number)

A constant number.

Expr(Expr)

An external expression of the caller.

Implementations

impl Value[src]

pub fn Byte(val: u8) -> Self[src]

pub fn Word(val: u16) -> Self[src]

pub fn Dword(val: u32) -> Self[src]

pub fn Qword(val: u64) -> Self[src]

pub fn repr(self) -> NumericRepr[src]

pub fn convert(self, repr: NumericRepr) -> Option<Self>[src]

pub fn size(self) -> Size[src]

Trait Implementations

impl Clone for Value[src]

impl Copy for Value[src]

impl Debug for Value[src]

impl<'_> From<&'_ Expr> for Value[src]

impl<'_> From<&'_ Value> for Stmt[src]

impl From<Expr> for Value[src]

impl From<Value> for JumpOffset[src]

impl From<Value> for Stmt[src]

impl From<u8> for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

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.