[][src]Enum zub::vm::value::object::Object

pub enum Object {
    String(String),
    Function(Function),
    NativeFunction(NativeFunction),
    Closure(Closure),
    List(List),
    Dict(Dict),
}

Variants

String(String)
Function(Function)
NativeFunction(NativeFunction)
Closure(Closure)
List(List)
Dict(Dict)

Implementations

impl Object[src]

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

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

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

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

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

pub fn native_fn(
    name: &str,
    arity: u8,
    function: fn(_: &mut Heap<Object>, _: &[Value]) -> Value
) -> Self
[src]

pub fn as_closure_mut(&mut self) -> Option<&mut Closure>[src]

Trait Implementations

impl Debug for Object[src]

impl Trace<Object> for Value[src]

impl Trace<Object> for Object[src]

impl Trace<Object> for Function[src]

impl Trace<Object> for Dict[src]

impl Trace<Object> for List[src]

impl Trace<Object> for Closure[src]

impl Trace<Object> for Chunk[src]

Auto Trait Implementations

impl !RefUnwindSafe for Object

impl !Send for Object

impl !Sync for Object

impl Unpin for Object

impl !UnwindSafe for Object

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> Same<T> for T

type Output = T

Should always be Self

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.