[][src]Struct lincoln_compiled::Context

pub struct Context(_);

A Context is a container of values. Ideally it should not have more than 20 elements but this is not a hard limit.

Methods

impl Context[src]

pub fn expect_args(&self, args: u8) -> Result<(), EvalError>[src]

A handy function for external functions. It checks that there is exactly the amount of values being stored in the context.

args: the number of arguments expected.

pub fn append(&mut self, other: &mut Self)[src]

Merge two context into one. The second context put last.

other: the other context to merge

pub fn iterate(&mut self) -> impl Iterator<Item = Box<dyn Value>>[src]

Take all value out and append to a vector.

pub fn len(&self) -> u8[src]

Receive the length of the context.

pub fn split(&mut self, at: u8) -> Result<Self, ValueAccessError>[src]

Split the context into two pieces. Used to construct closures.

at: where to split up

pub fn push(&mut self, v: Box<dyn Value>)[src]

Store one more value to the context. The lenghth increases by 1.

v: the value to store

pub fn pop(&mut self) -> Result<Box<dyn Value>, ValueAccessError>[src]

Retrive a value from the context. The length decreases by 1. Fail if the context is empty.

pub fn permutate(&mut self, p: Permutation)[src]

Perform a permutation over the values.

p: the permutation to perform.

Trait Implementations

impl Drop for Context[src]

impl Default for Context[src]

impl Display for Context[src]

Auto Trait Implementations

impl !Send for Context

impl !Sync for Context

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]