Struct jrsonnet_stdlib::ContextInitializer
source · pub struct ContextInitializer { /* private fields */ }
Implementations§
source§impl ContextInitializer
impl ContextInitializer
pub fn new(_s: State, resolver: PathResolver) -> Self
pub fn settings(&self) -> Ref<'_, Settings>
pub fn settings_mut(&self) -> RefMut<'_, Settings>
pub fn add_ext_var(&self, name: IStr, value: Val)
pub fn add_ext_str(&self, name: IStr, value: IStr)
pub fn add_ext_code(&self, name: &str, code: impl Into<IStr>) -> Result<()>
pub fn add_native(&self, name: impl Into<IStr>, cb: impl Into<FuncVal>)
Trait Implementations§
source§impl Clone for ContextInitializer
impl Clone for ContextInitializer
source§fn clone(&self) -> ContextInitializer
fn clone(&self) -> ContextInitializer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ContextInitializer for ContextInitializer
impl ContextInitializer for ContextInitializer
source§fn reserve_vars(&self) -> usize
fn reserve_vars(&self) -> usize
For which size the builder should be preallocated
source§fn initialize(&self, _s: State, _source: Source) -> Context
fn initialize(&self, _s: State, _source: Source) -> Context
Initialize default file context.
Has default implementation, which calls
populate
.
Prefer to always implement populate
instead.source§fn populate(&self, _for_file: Source, builder: &mut ContextBuilder)
fn populate(&self, _for_file: Source, builder: &mut ContextBuilder)
For composability: extend builder. May panic if this initialization is not supported,
and the context may only be created via
initialize
.Auto Trait Implementations§
impl !RefUnwindSafe for ContextInitializer
impl !Send for ContextInitializer
impl !Sync for ContextInitializer
impl Unpin for ContextInitializer
impl !UnwindSafe for ContextInitializer
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