[][src]Struct mtots_core::Globals

pub struct Globals { /* fields omitted */ }

The global state for mtots

Implementations

impl Globals[src]

pub fn add<E: Into<GlobalElement>>(&mut self, e: E) -> Result<()>[src]

impl Globals[src]

Functions for readline-style editing and history These functions only work if the "line" feature of this crate is enabled. Otherwise these will be nops (for history related) and a much more primitive implementation (for the readline method).

pub fn readline(&mut self, prompt: &str) -> Result<Option<String>>[src]

Read a line of input Analogous to Python's 'input' function Uses rustyline if the line feature is enabled

pub fn save_line_history(&mut self) -> Result<()>[src]

impl Globals[src]

pub fn new_handle<T: Any>(&mut self, t: T) -> Result<Handle<T>>[src]

pub fn set_handle_class<T: Any>(&mut self, cls: Rc<Class>) -> Result<()>[src]

impl Globals[src]

pub fn load(&mut self, name: &RcStr) -> Result<&Rc<Module>>[src]

impl Globals[src]

pub fn parse(&self, source: Rc<Source>) -> Result<ModuleDisplay>[src]

pub fn repl_ready(&self, line: &str) -> bool[src]

impl Globals[src]

pub fn stash(&self) -> &Stash[src]

pub fn stash_mut(&mut self) -> &mut Stash[src]

impl Globals[src]

pub fn handle_trampoline(self)[src]

If there is any pending trampoline request, handle it.

pub fn handle_trampoline_and_last_result<T>(self, r: Result<T>)[src]

pub fn request_trampoline<R, F>(&mut self, trampoline: F) -> Result<R> where
    F: FnOnce(Globals) + 'static, 
[src]

impl Globals[src]

pub fn new() -> Self[src]

pub fn trace(&self) -> &Vec<Mark>[src]

pub fn trace_unwind(&mut self, len: usize)[src]

pub fn register_module(&mut self, module: Rc<Module>) -> Result<()>[src]

pub fn class_manager(&self) -> &ClassManager[src]

pub fn get_main(&self) -> &Option<RcStr>[src]

pub fn set_main(&mut self, main_module_name: RcStr)[src]

pub fn exec(&mut self, source: Rc<Source>) -> Result<Rc<Module>>[src]

pub fn exec_str(
    &mut self,
    name: &str,
    path: Option<&str>,
    data: &str
) -> Result<Rc<Module>>
[src]

pub fn exec_repl(&mut self, data: &str) -> Result<Value>[src]

pub fn argv(&self) -> &Option<Vec<RcStr>>[src]

pub fn set_argv(&mut self, argv: Vec<RcStr>)[src]

impl Globals[src]

Auto Trait Implementations

impl !RefUnwindSafe for Globals

impl !Send for Globals

impl !Sync for Globals

impl Unpin for Globals

impl !UnwindSafe for Globals

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.