pub struct Context { /* private fields */ }
Implementations§
source§impl Context
impl Context
pub fn new(module_importer: impl ModuleImporter + Send + Sync + 'static) -> Self
pub fn new_without_importer() -> Self
pub fn set_debug(&mut self, activate: bool)
pub fn load_currency_module_on_demand(&mut self, yes: bool)
sourcepub fn prefetch_exchange_rates()
pub fn prefetch_exchange_rates()
Fill the currency exchange rate cache. This call is blocking.
pub fn set_exchange_rates(xml_content: &str)
pub fn variable_names(&self) -> impl Iterator<Item = String> + '_
pub fn function_names(&self) -> impl Iterator<Item = String> + '_
pub fn unit_names(&self) -> &[Vec<String>]
pub fn dimension_names(&self) -> &[String]
pub fn print_environment(&self) -> Markup
pub fn print_functions(&self) -> Markup
pub fn print_dimensions(&self) -> Markup
pub fn print_variables(&self) -> Markup
pub fn print_units(&self) -> Markup
sourcepub fn get_completions_for<'a>(
&self,
word_part: &'a str,
add_paren: bool
) -> impl Iterator<Item = String> + 'a
pub fn get_completions_for<'a>( &self, word_part: &'a str, add_paren: bool ) -> impl Iterator<Item = String> + 'a
Gets completions for the given word_part
If add_paren
is true, then an opening paren will be added to the end of function names
pub fn print_info_for_keyword(&mut self, keyword: &str) -> Markup
pub fn list_modules(&self) -> impl Iterator<Item = String>
pub fn dimension_registry(&self) -> &DimensionRegistry
pub fn base_units(&self) -> impl Iterator<Item = String> + '_
pub fn unit_representations( &self ) -> impl Iterator<Item = (String, (BaseRepresentation, UnitMetadata))> + '_
pub fn resolver(&self) -> &Resolver
pub fn interpret( &mut self, code: &str, code_source: CodeSource ) -> Result<(Vec<Statement>, InterpreterResult), NumbatError>
pub fn interpret_with_settings( &mut self, settings: &mut InterpreterSettings, code: &str, code_source: CodeSource ) -> Result<(Vec<Statement>, InterpreterResult), NumbatError>
pub fn print_diagnostic(&self, error: impl ErrorDiagnostic)
pub fn set_terminal_width(&mut self, width: Option<usize>)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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