[−][src]Struct mtots_core::Globals
The global state for mtots
Implementations
impl Globals
[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]
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]
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]
F: FnOnce(Globals) + 'static,
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]
&mut self,
name: &str,
path: Option<&str>,
data: &str
) -> Result<Rc<Module>>
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]
pub fn add_builtin_native_libraries(&mut self)
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,