Struct jrsonnet_evaluator::EvaluationState [−][src]
pub struct EvaluationState(_);
Maintains stack trace and import resolution
Implementations
impl EvaluationState
[src]
impl EvaluationState
[src]pub fn add_file(&self, path: Rc<PathBuf>, source_code: IStr) -> Result<()>
[src]
Parses and adds file as loaded
pub fn add_parsed_file(
&self,
name: Rc<PathBuf>,
source_code: IStr,
parsed: LocExpr
) -> Result<()>
[src]
&self,
name: Rc<PathBuf>,
source_code: IStr,
parsed: LocExpr
) -> Result<()>
Adds file by source code and parsed expr
pub fn get_source(&self, name: &PathBuf) -> Option<IStr>
[src]
pub fn map_source_locations(
&self,
file: &PathBuf,
locs: &[usize]
) -> Vec<CodeLocation>
[src]
&self,
file: &PathBuf,
locs: &[usize]
) -> Vec<CodeLocation>
pub fn with_stdlib(&self) -> &Self
[src]
Adds standard library global variable (std) to this evaluator
pub fn create_default_context(&self) -> Context
[src]
Creates context with all passed global variables
pub fn push<T>(
&self,
e: Option<&ExprLocation>,
frame_desc: impl FnOnce() -> String,
f: impl FnOnce() -> Result<T>
) -> Result<T>
[src]
&self,
e: Option<&ExprLocation>,
frame_desc: impl FnOnce() -> String,
f: impl FnOnce() -> Result<T>
) -> Result<T>
Executes code creating a new stack frame
pub fn run_in_state<T>(&self, f: impl FnOnce() -> T) -> T
[src]
Runs passed function in state (required if function needs to modify stack trace)
pub fn stringify_err(&self, e: &LocError) -> String
[src]
pub fn manifest(&self, val: Val) -> Result<IStr>
[src]
pub fn manifest_multi(&self, val: Val) -> Result<Vec<(IStr, IStr)>>
[src]
pub fn manifest_stream(&self, val: Val) -> Result<Vec<IStr>>
[src]
pub fn with_tla(&self, val: Val) -> Result<Val>
[src]
If passed value is function then call with set TLA
impl EvaluationState
[src]
impl EvaluationState
[src]Internals
pub fn settings(&self) -> Ref<'_, EvaluationSettings>
[src]
pub fn settings_mut(&self) -> RefMut<'_, EvaluationSettings>
[src]
impl EvaluationState
[src]
impl EvaluationState
[src]Raw methods evaluate passed values but don’t perform TLA execution
pub fn evaluate_file_raw(&self, name: &PathBuf) -> Result<Val>
[src]
pub fn evaluate_file_raw_nocwd(&self, name: &PathBuf) -> Result<Val>
[src]
pub fn evaluate_snippet_raw(
&self,
source: Rc<PathBuf>,
code: IStr
) -> Result<Val>
[src]
&self,
source: Rc<PathBuf>,
code: IStr
) -> Result<Val>
Parses and evaluates the given snippet
pub fn evaluate_expr_raw(&self, code: LocExpr) -> Result<Val>
[src]
Evaluates the parsed expression
impl EvaluationState
[src]
impl EvaluationState
[src]Settings utilities
pub fn add_ext_var(&self, name: IStr, value: Val)
[src]
pub fn add_ext_str(&self, name: IStr, value: IStr)
[src]
pub fn add_ext_code(&self, name: IStr, code: IStr) -> Result<()>
[src]
pub fn add_tla(&self, name: IStr, value: Val)
[src]
pub fn add_tla_str(&self, name: IStr, value: IStr)
[src]
pub fn add_tla_code(&self, name: IStr, code: IStr) -> Result<()>
[src]
pub fn resolve_file(
&self,
from: &PathBuf,
path: &PathBuf
) -> Result<Rc<PathBuf>>
[src]
&self,
from: &PathBuf,
path: &PathBuf
) -> Result<Rc<PathBuf>>
pub fn load_file_contents(&self, path: &PathBuf) -> Result<IStr>
[src]
pub fn import_resolver(&self) -> Ref<'_, dyn ImportResolver>
[src]
pub fn set_import_resolver(&self, resolver: Box<dyn ImportResolver>)
[src]
pub fn add_native(&self, name: IStr, cb: Rc<NativeCallback>)
[src]
pub fn manifest_format(&self) -> ManifestFormat
[src]
pub fn set_manifest_format(&self, format: ManifestFormat)
[src]
pub fn trace_format(&self) -> Ref<'_, dyn TraceFormat>
[src]
pub fn set_trace_format(&self, format: Box<dyn TraceFormat>)
[src]
pub fn max_trace(&self) -> usize
[src]
pub fn set_max_trace(&self, trace: usize)
[src]
pub fn max_stack(&self) -> usize
[src]
pub fn set_max_stack(&self, trace: usize)
[src]
Trait Implementations
impl Clone for EvaluationState
[src]
impl Clone for EvaluationState
[src]fn clone(&self) -> EvaluationState
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for EvaluationState
[src]
impl Default for EvaluationState
[src]fn default() -> EvaluationState
[src]
Auto Trait Implementations
impl !RefUnwindSafe for EvaluationState
impl !RefUnwindSafe for EvaluationState
impl !Send for EvaluationState
impl !Send for EvaluationState
impl !Sync for EvaluationState
impl !Sync for EvaluationState
impl Unpin for EvaluationState
impl Unpin for EvaluationState
impl !UnwindSafe for EvaluationState
impl !UnwindSafe for EvaluationState