Struct jrsonnet_evaluator::State
source · pub struct State(_);
Expand description
Maintains stack trace and import resolution
Implementations§
source§impl State
impl State
sourcepub fn import_resolved_str(&self, path: SourcePath) -> Result<IStr>
pub fn import_resolved_str(&self, path: SourcePath) -> Result<IStr>
Should only be called with path retrieved from [resolve_path
], may panic otherwise
sourcepub fn import_resolved_bin(&self, path: SourcePath) -> Result<IBytes>
pub fn import_resolved_bin(&self, path: SourcePath) -> Result<IBytes>
Should only be called with path retrieved from [resolve_path
], may panic otherwise
sourcepub fn import_resolved(&self, path: SourcePath) -> Result<Val>
pub fn import_resolved(&self, path: SourcePath) -> Result<Val>
Should only be called with path retrieved from [resolve_path
], may panic otherwise
sourcepub fn import_from(&self, from: &SourcePath, path: &str) -> Result<Val>
pub fn import_from(&self, from: &SourcePath, path: &str) -> Result<Val>
Has same semantics as import 'path'
called from from
file
pub fn import(&self, path: impl AsRef<Path>) -> Result<Val>
sourcepub fn create_default_context(&self, source: Source) -> Context
pub fn create_default_context(&self, source: Source) -> Context
Creates context with all passed global variables
sourcepub fn push<T>(
e: CallLocation<'_>,
frame_desc: impl FnOnce() -> String,
f: impl FnOnce() -> Result<T>
) -> Result<T>
pub fn push<T>( e: CallLocation<'_>, frame_desc: impl FnOnce() -> String, f: impl FnOnce() -> Result<T> ) -> Result<T>
Executes code creating a new stack frame
source§impl State
impl State
Internals
pub fn settings(&self) -> Ref<'_, EvaluationSettings>
pub fn settings_mut(&self) -> RefMut<'_, EvaluationSettings>
source§impl State
impl State
Settings utilities
pub fn resolve_from(&self, from: &SourcePath, path: &str) -> Result<SourcePath>
pub fn resolve(&self, path: impl AsRef<Path>) -> Result<SourcePath>
pub fn import_resolver(&self) -> Ref<'_, dyn ImportResolver>
pub fn set_import_resolver(&self, resolver: impl ImportResolver)
pub fn context_initializer(&self) -> Ref<'_, dyn ContextInitializer>
pub fn set_context_initializer(&self, initializer: impl ContextInitializer)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for State
impl !Send for State
impl !Sync for State
impl Unpin for State
impl !UnwindSafe for State
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