[−][src]Struct lincoln_compiled::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
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,