[][src]Enum llhd::value::Value

pub enum Value {
    Void,
    Time(TimeValue),
    Int(IntValue),
    Array(ArrayValue),
    Struct(StructValue),
}

A value.

Variants

Void
Time(TimeValue)
Array(ArrayValue)
Struct(StructValue)

Methods

impl Value[src]

pub fn zero(ty: &Type) -> Value[src]

Create the zero value for a type.

pub fn get_time(&self) -> Option<&TimeValue>[src]

If this value is a time, access it.

pub fn unwrap_time(&self) -> &TimeValue[src]

Unwrap this value as a time, or panic.

pub fn get_int(&self) -> Option<&IntValue>[src]

If this value is an integer, access it.

pub fn unwrap_int(&self) -> &IntValue[src]

Unwrap this value as an integer, or panic.

pub fn get_array(&self) -> Option<&ArrayValue>[src]

If this value is an array, access it.

pub fn unwrap_array(&self) -> &ArrayValue[src]

Unwrap this value as an array, or panic.

pub fn get_struct(&self) -> Option<&StructValue>[src]

If this value is a struct, access it.

pub fn unwrap_struct(&self) -> &StructValue[src]

Unwrap this value as a struct, or panic.

pub fn ty(&self) -> Type[src]

Get the type of the value.

pub fn is_zero(&self) -> bool[src]

Check if the value is zero.

pub fn is_one(&self) -> bool[src]

Check if the value is one.

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl<'de> Deserialize<'de> for Value[src]

impl Display for Value[src]

impl Eq for Value[src]

impl From<ArrayValue> for Value[src]

impl From<IntValue> for Value[src]

impl From<StructValue> for Value[src]

impl From<TimeValue> for Value[src]

impl PartialEq<Value> for Value[src]

impl Serialize for Value[src]

impl StructuralEq for Value[src]

impl StructuralPartialEq 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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[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> ToString for T where
    T: Display + ?Sized
[src]

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.