Struct rail_lang::v1::rail_machine::RailState
source · 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
impl RailState
pub fn new( context: Context, definitions: Dictionary, conventions: &'static RunConventions<'_> ) -> RailState
pub fn new_main( definitions: Dictionary, conventions: &'static RunConventions<'_> ) -> RailState
pub fn in_main(&self) -> bool
pub fn get_def(&self, name: &str) -> Option<RailDef<'_>>
pub fn child(&self) -> Self
pub fn run_tokens(self, tokens: Vec<Token>) -> RailRunResult
pub fn run_token(self, token: Token) -> RailRunResult
pub fn run_val(self, value: RailVal, local_state: RailState) -> RailRunResult
pub fn run_in_state(self, other_state: RailState) -> RailRunResult
pub fn jailed_run_in_state(self, other_state: RailState) -> RailRunResult
pub fn update_stack(self, update: impl Fn(Stack) -> Stack) -> RailState
pub fn update_stack_and_defs( self, update: impl Fn(Stack, Dictionary) -> (Stack, Dictionary) ) -> RailState
pub fn replace_stack(self, stack: Stack) -> RailState
pub fn replace_definitions(self, definitions: Dictionary) -> RailState
pub fn replace_context(self, context: Context) -> RailState
pub fn deeper(self) -> Self
pub fn higher(self) -> RailRunResult
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn reverse(self) -> Self
pub fn push(self, term: RailVal) -> Self
pub fn push_bool(self, b: bool) -> Self
pub fn push_i64(self, i: i64) -> Self
pub fn push_f64(self, n: f64) -> Self
pub fn push_command(self, op_name: &str) -> Self
pub fn push_deferred_command(self, op_name: &str) -> Self
pub fn push_quote(self, quote: RailState) -> Self
pub fn push_stab(self, st: Stab) -> Self
pub fn push_string(self, s: String) -> Self
pub fn push_str(self, s: &str) -> Self
pub fn pop(self) -> (RailVal, Self)
pub fn pop_bool(self, context: &str) -> (bool, Self)
pub fn pop_i64(self, context: &str) -> (i64, Self)
pub fn pop_f64(self, context: &str) -> (f64, Self)
pub fn pop_quote(self, context: &str) -> (RailState, Self)
pub fn pop_stab(self, context: &str) -> (Stab, Self)
pub fn pop_stab_entry(self, context: &str) -> (String, RailVal, Self)
pub fn pop_string(self, context: &str) -> (String, Self)
pub fn enqueue(self, value: RailVal) -> Self
pub fn dequeue(self) -> (RailVal, Self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RailState
impl !Send for RailState
impl !Sync for RailState
impl Unpin for RailState
impl !UnwindSafe for RailState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more