TS

Struct TS 

Source
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

Source

pub fn new() -> Self

Create and initialize TS structure with a single anonymous stack

Source

pub fn new_with_named(name: String) -> Self

Create and initialize TS structure with a single named stack

Source§

impl TS

Source

pub fn add_stack(&mut self) -> &mut TS

Source

pub fn add_named_stack(&mut self, name: String) -> &mut TS

Source

pub fn add_named_fifo(&mut self, name: String) -> &mut TS

Source§

impl TS

Source

pub fn len(&self) -> usize

Source

pub fn current_stack_len(&mut self) -> usize

Source

pub fn stack_len(&mut self, name: String) -> usize

Source

pub fn is_empty(&self) -> bool

Source§

impl TS

Source

pub fn ensure(&mut self) -> &mut TS

Source

pub fn ensure_stack(&mut self, name: String) -> &mut TS

Source

pub fn ensure_stack_with_capacity( &mut self, name: String, capacity: usize, ) -> &mut TS

Source

pub fn stack_exists(&mut self, name: String) -> bool

Source§

impl TS

Source

pub fn stack_capacity(&self, name: String) -> Option<usize>

Source§

impl TS

Source

pub fn to_current(&mut self, name: String) -> Result<&mut TS, Error>

Source

pub fn to_stack(&mut self, name: String) -> Result<&mut TS, Error>

Source§

impl TS

Source

pub fn clear(&mut self) -> &mut TS

Source§

impl TS

Source

pub fn current_stack_name(&mut self) -> Option<String>

Source

pub fn current(&mut self) -> Option<&mut Stack<Value>>

Source

pub fn stack(&mut self, name: String) -> Option<&mut Stack<Value>>

Source§

impl TS

Source

pub fn register_function( &mut self, name: String, fun: AppFn, ) -> Result<&mut TS, Error>

Source

pub fn unregister_function(&mut self, name: String) -> Result<&mut TS, Error>

Source

pub fn get_function(&mut self, name: String) -> Result<AppFn, Error>

Source

pub fn f( &mut self, name: String, value1: Option<Value>, value2: Option<Value>, ) -> Result<&mut TS, Error>

Source§

impl TS

Source

pub fn register_inline( &mut self, name: String, fun: InlineFn, ) -> Result<&mut TS, Error>

Source

pub fn unregister_inline(&mut self, name: String) -> Result<&mut TS, Error>

Source

pub fn is_inline(&mut self, name: String) -> bool

Source

pub fn get_inline(&mut self, name: String) -> Result<InlineFn, Error>

Source

pub fn i(&mut self, name: String) -> Result<&mut TS, Error>

Source§

impl TS

Source

pub fn left(&mut self) -> &mut TS

Source

pub fn right(&mut self) -> &mut TS

Source§

impl TS

Source

pub fn rotate_current_stack_left(&mut self) -> &mut TS

Source

pub fn rotate_stack_left(&mut self, name: String) -> &mut TS

Source

pub fn rotate_current_stack_right(&mut self) -> &mut TS

Source

pub fn rotate_stack_right(&mut self, name: String) -> &mut TS

Source§

impl TS

Source

pub fn push(&mut self, value: Value) -> &mut TS

Source

pub fn push_to_stack(&mut self, name: String, value: Value) -> &mut TS

Source§

impl TS

Source

pub fn pull(&mut self) -> Option<Value>

Source

pub fn pull_from_stack(&mut self, name: String) -> Option<Value>

Source§

impl TS

Source

pub fn peek(&mut self) -> Option<Value>

Source

pub fn peek_from_stack(&mut self, name: String) -> Option<Value>

Source§

impl TS

Source

pub fn move_from_current(&mut self, name_to: String) -> &mut TS

Source

pub fn move_to_current(&mut self, name_from: String) -> &mut TS

Source

pub fn move_from_stack(&mut self, name_from: String, name_to: String) -> &mut TS

Source§

impl TS

Source

pub fn drop(&mut self) -> Result<&mut TS, Error>

Source

pub fn drop_in(&mut self, name: String) -> Result<&mut TS, Error>

Source§

impl TS

Source

pub fn drop_stack(&mut self) -> Result<&mut TS, Error>

Source§

impl TS

Source

pub fn dup_in_current_stack(&mut self, n: i64) -> Result<&mut TS, Error>

Source

pub fn dup_in_stack(&mut self, n: i64, name: String) -> Result<&mut TS, Error>

Source

pub fn many_in_current_stack( &mut self, n: i64, value: Value, ) -> Result<&mut TS, Error>

Source

pub fn many_in_stack( &mut self, n: i64, name: String, value: Value, ) -> Result<&mut TS, Error>

Source

pub fn swap_in_current_stack(&mut self, n: i64) -> Result<&mut TS, Error>

Source

pub fn swap_in_stack(&mut self, n: i64, name: String) -> Result<&mut TS, Error>

Source§

impl TS

Source

pub fn fold_current(&mut self) -> Result<&mut TS, Error>

Source

pub fn fold_all_in_current(&mut self) -> Result<&mut TS, Error>

Source

pub fn fold_stack(&mut self, name: String) -> Result<&mut TS, Error>

Source§

impl TS

Source

pub fn pull_from_workbench(&mut self) -> Option<Value>

Source

pub fn push_to_workbench(&mut self, value: Value) -> &mut TS

Source

pub fn return_from_current_to_workbench(&mut self) -> Result<&mut TS, Error>

Source

pub fn return_from_stack_to_workbench( &mut self, name: String, ) -> Result<&mut TS, Error>

Source

pub fn return_from_workbench_to_current(&mut self) -> Result<&mut TS, Error>

Source

pub fn return_from_workbench_to_stack( &mut self, name: String, ) -> Result<&mut TS, Error>

Trait Implementations§

Source§

impl Clone for TS

Source§

fn clone(&self) -> TS

Returns a duplicate 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§

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V