pub struct RailState {
    pub stack: Stack,
    pub definitions: Dictionary,
    pub context: Context,
    pub conventions: &'static RunConventions<'static>,
}

Fields§

§stack: Stack§definitions: Dictionary§context: Context§conventions: &'static RunConventions<'static>

Implementations§

source§

impl RailState

source

pub fn new( context: Context, definitions: Dictionary, conventions: &'static RunConventions<'_> ) -> RailState

source

pub fn new_main( definitions: Dictionary, conventions: &'static RunConventions<'_> ) -> RailState

source

pub fn in_main(&self) -> bool

source

pub fn get_def(&self, name: &str) -> Option<RailDef<'_>>

source

pub fn child(&self) -> Self

source

pub fn run_tokens(self, tokens: Vec<Token>) -> RailRunResult

source

pub fn run_token(self, token: Token) -> RailRunResult

source

pub fn run_val(self, value: RailVal, local_state: RailState) -> RailRunResult

source

pub fn run_in_state(self, other_state: RailState) -> RailRunResult

source

pub fn jailed_run_in_state(self, other_state: RailState) -> RailRunResult

source

pub fn update_stack(self, update: impl Fn(Stack) -> Stack) -> RailState

source

pub fn update_stack_and_defs( self, update: impl Fn(Stack, Dictionary) -> (Stack, Dictionary) ) -> RailState

source

pub fn replace_stack(self, stack: Stack) -> RailState

source

pub fn replace_definitions(self, definitions: Dictionary) -> RailState

source

pub fn replace_context(self, context: Context) -> RailState

source

pub fn deeper(self) -> Self

source

pub fn higher(self) -> RailRunResult

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn reverse(self) -> Self

source

pub fn push(self, term: RailVal) -> Self

source

pub fn push_bool(self, b: bool) -> Self

source

pub fn push_i64(self, i: i64) -> Self

source

pub fn push_f64(self, n: f64) -> Self

source

pub fn push_command(self, op_name: &str) -> Self

source

pub fn push_deferred_command(self, op_name: &str) -> Self

source

pub fn push_quote(self, quote: RailState) -> Self

source

pub fn push_stab(self, st: Stab) -> Self

source

pub fn push_string(self, s: String) -> Self

source

pub fn push_str(self, s: &str) -> Self

source

pub fn pop(self) -> (RailVal, Self)

source

pub fn pop_bool(self, context: &str) -> (bool, Self)

source

pub fn pop_i64(self, context: &str) -> (i64, Self)

source

pub fn pop_f64(self, context: &str) -> (f64, Self)

source

pub fn pop_quote(self, context: &str) -> (RailState, Self)

source

pub fn pop_stab(self, context: &str) -> (Stab, Self)

source

pub fn pop_stab_entry(self, context: &str) -> (String, RailVal, Self)

source

pub fn pop_string(self, context: &str) -> (String, Self)

source

pub fn enqueue(self, value: RailVal) -> Self

source

pub fn dequeue(self) -> (RailVal, Self)

Trait Implementations§

source§

impl Clone for RailState

source§

fn clone(&self) -> RailState

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.