Struct yksom::vm::objects::UpVar[][src]

pub struct UpVar { /* fields omitted */ }

An UpVar references either a variable on the stack or, if the UpVar is closed, a copy of that variable inside the struct itself (the closed field). This scheme is very similar to that used in Lua; the best explanation I know of can be found at: http://www.craftinginterpreters.com/closures.html.

Implementations

impl UpVar[src]

pub fn new(prev: Option<Gc<UpVar>>, ptr: Gc<Val>) -> Self[src]

pub fn to_gc(&self) -> Gc<Val>[src]

pub fn close(&self)[src]

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

pub fn prev(&self) -> Option<Gc<UpVar>>[src]

pub fn set_prev(&self, prev: Option<Gc<UpVar>>)[src]

Trait Implementations

impl Clone for UpVar[src]

impl Debug for UpVar[src]

Auto Trait Implementations

impl !NoTrace for UpVar

impl !RefUnwindSafe for UpVar

impl Send for UpVar

impl !Sync for UpVar

impl Unpin for UpVar

impl !UnwindSafe for UpVar

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.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err