pub struct TS {
pub id: String,
pub stack: HashMap<String, Stack<Value>>,
pub stacks: VecDeque<String>,
pub stack_cap: HashMap<String, usize>,
pub workbench: Stack<Value>,
pub functions: HashMap<String, AppFn>,
pub inline_fun: HashMap<String, InlineFn>,
}Expand description
Principial structure provining interface to all funcitonality of multi-stack. To create TS structure you shall call TS::new() or TS::new_with_named(name)
Fields§
§id: String§stack: HashMap<String, Stack<Value>>§stacks: VecDeque<String>§stack_cap: HashMap<String, usize>§workbench: Stack<Value>§functions: HashMap<String, AppFn>§inline_fun: HashMap<String, InlineFn>Implementations§
Source§impl TS
impl TS
Sourcepub fn new_with_named(name: String) -> Self
pub fn new_with_named(name: String) -> Self
Create and initialize TS structure with a single named stack
Source§impl TS
impl TS
pub fn register_function( &mut self, name: String, fun: AppFn, ) -> Result<&mut TS, Error>
pub fn unregister_function(&mut self, name: String) -> Result<&mut TS, Error>
pub fn get_function(&mut self, name: String) -> Result<AppFn, Error>
pub fn f( &mut self, name: String, value1: Option<Value>, value2: Option<Value>, ) -> Result<&mut TS, Error>
Source§impl TS
impl TS
pub fn register_inline( &mut self, name: String, fun: InlineFn, ) -> Result<&mut TS, Error>
pub fn unregister_inline(&mut self, name: String) -> Result<&mut TS, Error>
pub fn is_inline(&mut self, name: String) -> bool
pub fn get_inline(&mut self, name: String) -> Result<InlineFn, Error>
pub fn i(&mut self, name: String) -> Result<&mut TS, Error>
Source§impl TS
impl TS
pub fn rotate_current_stack_left(&mut self) -> &mut TS
pub fn rotate_stack_left(&mut self, name: String) -> &mut TS
pub fn rotate_current_stack_right(&mut self) -> &mut TS
pub fn rotate_stack_right(&mut self, name: String) -> &mut TS
Source§impl TS
impl TS
pub fn move_from_current(&mut self, name_to: String) -> &mut TS
pub fn move_to_current(&mut self, name_from: String) -> &mut TS
pub fn move_from_stack(&mut self, name_from: String, name_to: String) -> &mut TS
Source§impl TS
impl TS
pub fn dup_in_current_stack(&mut self, n: i64) -> Result<&mut TS, Error>
pub fn dup_in_stack(&mut self, n: i64, name: String) -> Result<&mut TS, Error>
pub fn many_in_current_stack( &mut self, n: i64, value: Value, ) -> Result<&mut TS, Error>
pub fn many_in_stack( &mut self, n: i64, name: String, value: Value, ) -> Result<&mut TS, Error>
pub fn swap_in_current_stack(&mut self, n: i64) -> Result<&mut TS, Error>
pub fn swap_in_stack(&mut self, n: i64, name: String) -> Result<&mut TS, Error>
Source§impl TS
impl TS
pub fn pull_from_workbench(&mut self) -> Option<Value>
pub fn push_to_workbench(&mut self, value: Value) -> &mut TS
pub fn return_from_current_to_workbench(&mut self) -> Result<&mut TS, Error>
pub fn return_from_stack_to_workbench( &mut self, name: String, ) -> Result<&mut TS, Error>
pub fn return_from_workbench_to_current(&mut self) -> Result<&mut TS, Error>
pub fn return_from_workbench_to_stack( &mut self, name: String, ) -> Result<&mut TS, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TS
impl RefUnwindSafe for TS
impl Send for TS
impl Sync for TS
impl Unpin for TS
impl UnwindSafe for TS
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more