[][src]Struct ralik::Value

pub struct Value { /* fields omitted */ }

Implementations

impl Value[src]

pub fn new_unit(context: &Context) -> Result<Value, TupleCreationError>[src]

pub fn new_bool(
    context: &Context,
    value: impl Into<bool>
) -> Result<Value, BoolCreationError>
[src]

pub fn new_char(
    context: &Context,
    value: impl Into<char>
) -> Result<Value, CharCreationError>
[src]

pub fn new_integer(
    context: &Context,
    value: impl Into<BigInt>
) -> Result<Value, IntegerCreationError>
[src]

pub fn new_string(
    context: &Context,
    value: impl Into<Box<str>>
) -> Result<Value, StringCreationError>
[src]

pub fn new_tuple(
    context: &Context,
    values: impl Into<Box<[Value]>>
) -> Result<Value, TupleCreationError>
[src]

pub fn new_tuple_struct(
    context: &Context,
    name: impl AsRef<str>,
    values: impl Into<Box<[Value]>>
) -> Result<Value, TupleStructCreationError>
[src]

pub fn new_struct(
    context: &Context,
    name: impl AsRef<str>,
    fields: impl Iterator<Item = (impl AsRef<str>, Value)>
) -> Result<Value, StructCreationError>
[src]

pub fn new_unit_struct(
    context: &Context,
    name: impl AsRef<str>
) -> Result<Value, UnitStructCreationError>
[src]

pub fn new_array(
    context: &Context,
    element_type: &TypeHandle,
    values: impl Into<Box<[Value]>>
) -> Result<Value, ArrayCreationError>
[src]

pub fn new_enum_unit_variant(
    context: &Context,
    name: impl AsRef<str>,
    variant_name: impl AsRef<str>
) -> Result<Value, EnumUnitVariantCreationError>
[src]

pub fn new_enum_tuple_variant(
    context: &Context,
    name: impl AsRef<str>,
    variant_name: impl AsRef<str>,
    values: impl Into<Box<[Value]>>
) -> Result<Value, EnumTupleVariantCreationError>
[src]

pub fn new_enum_struct_variant(
    context: &Context,
    name: impl AsRef<str>,
    variant_name: impl AsRef<str>,
    fields: impl Iterator<Item = (impl AsRef<str>, Value)>
) -> Result<Value, EnumStructVariantCreationError>
[src]

impl Value[src]

pub fn get_type(&self) -> &TypeHandle[src]

pub fn has_type(&self, expected_type: &TypeHandle) -> bool[src]

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

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

pub fn as_char(&self) -> Option<char>[src]

pub fn as_integer(&self) -> Option<&BigInt>[src]

pub fn as_i8(&self) -> Option<i8>[src]

pub fn as_u8(&self) -> Option<u8>[src]

pub fn as_i16(&self) -> Option<i16>[src]

pub fn as_u16(&self) -> Option<u16>[src]

pub fn as_i32(&self) -> Option<i32>[src]

pub fn as_u32(&self) -> Option<u32>[src]

pub fn as_i64(&self) -> Option<i64>[src]

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

pub fn as_i128(&self) -> Option<i128>[src]

pub fn as_u128(&self) -> Option<u128>[src]

pub fn as_isize(&self) -> Option<isize>[src]

pub fn as_usize(&self) -> Option<usize>[src]

pub fn as_array(&self) -> Option<&[Value]>[src]

pub fn as_string(&self) -> Option<&str>[src]

pub fn as_variant_id(&self) -> Option<usize>[src]

pub fn field(&self, name: &str) -> Option<&Value>[src]

pub fn tuple_field(&self, index: usize) -> Option<&Value>[src]

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Display 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> 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.