Struct ketos::function::Lambda [] [src]

pub struct Lambda {
    pub code: Rc<Code>,
    pub scope: WeakScope,
    pub values: Option<Rc<Box<[Value]>>>,
}

Represents a function that evaluates an expression.

Fields

code: Rc<Code>

Bytecode implementation

scope: WeakScope

Scope in which the lambda was created. A weak reference is used to prevent cycles.

values: Option<Rc<Box<[Value]>>>

Enclosed values

Methods

impl Lambda
[src]

fn new(code: Rc<Code>, scope: &Scope) -> Lambda

Creates a new Lambda.

fn new_closure(code: Rc<Code>, scope: WeakScope, values: Box<[Value]>) -> Lambda

Creates a new Lambda enclosing a set of values.

Trait Implementations

impl Clone for Lambda
[src]

fn clone(&self) -> Lambda

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Debug for Lambda
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl PartialEq for Lambda
[src]

fn eq(&self, rhs: &Lambda) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl<'a> FromValueRef<'a> for &'a Lambda
[src]

fn from_value_ref(v: &'a Value) -> Result<&'a LambdaExecError>

Returns the borrowed value

impl FromValue for Lambda
[src]

fn from_value(v: Value) -> Result<LambdaExecError>

Consumes the Value and returns a Rust value