#[non_exhaustive]pub struct CallCx<'a> {
pub workspace_root: &'a Path,
pub env_vars: &'a EnvVarMode,
pub limits: &'a EvalLimits,
}Expand description
Per-call context handed to each HclFunc::call.
CallCx is intentionally read-only so functions cannot mutate the
evaluator’s state. Path-safety helpers (canonicalize_inside) take
&Path, so workspace_root is borrowed; the EnvVarMode and
EvalLimits are likewise references.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.workspace_root: &'a PathAbsolute, canonicalised workspace root for path-sandboxing.
env_vars: &'a EnvVarModeHow get_env(...) should treat the process environment.
limits: &'a EvalLimitsResource limits enforced inside function bodies (string size, list length, file read size).
Implementations§
Source§impl<'a> CallCx<'a>
impl<'a> CallCx<'a>
Sourcepub const fn new(
workspace_root: &'a Path,
env_vars: &'a EnvVarMode,
limits: &'a EvalLimits,
) -> Self
pub const fn new( workspace_root: &'a Path, env_vars: &'a EnvVarMode, limits: &'a EvalLimits, ) -> Self
Construct a new CallCx from explicit pieces.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CallCx<'a>
impl<'a> RefUnwindSafe for CallCx<'a>
impl<'a> Send for CallCx<'a>
impl<'a> Sync for CallCx<'a>
impl<'a> Unpin for CallCx<'a>
impl<'a> UnsafeUnpin for CallCx<'a>
impl<'a> UnwindSafe for CallCx<'a>
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