pub struct VariableEngine { /* private fields */ }Expand description
Hierarchical variable scoping engine.
Implementations§
Source§impl VariableEngine
impl VariableEngine
pub fn new() -> Self
Sourcepub fn create_scope(
&mut self,
scope_type: ScopeType,
parent_scope_id: Option<&str>,
) -> String
pub fn create_scope( &mut self, scope_type: ScopeType, parent_scope_id: Option<&str>, ) -> String
Create a new scope.
Sourcepub fn set(
&mut self,
scope_id: &str,
name: &str,
value: Value,
var_type: VariableType,
set_by: &str,
) -> WorkflowResult<()>
pub fn set( &mut self, scope_id: &str, name: &str, value: Value, var_type: VariableType, set_by: &str, ) -> WorkflowResult<()>
Set a variable in a scope.
Sourcepub fn get(&self, scope_id: &str, name: &str) -> WorkflowResult<&ScopedVariable>
pub fn get(&self, scope_id: &str, name: &str) -> WorkflowResult<&ScopedVariable>
Get a variable, respecting scope hierarchy (child → parent cascade).
Sourcepub fn list(&self, scope_id: &str) -> WorkflowResult<Vec<&ScopedVariable>>
pub fn list(&self, scope_id: &str) -> WorkflowResult<Vec<&ScopedVariable>>
List all variables in a scope (not including parent).
Sourcepub fn promote(&mut self, scope_id: &str, name: &str) -> WorkflowResult<()>
pub fn promote(&mut self, scope_id: &str, name: &str) -> WorkflowResult<()>
Promote a variable from child scope to parent scope.
Sourcepub fn type_check(&self) -> TypeCheckResult
pub fn type_check(&self) -> TypeCheckResult
Type check all variables across scopes.
Sourcepub fn make_immutable(
&mut self,
scope_id: &str,
name: &str,
) -> WorkflowResult<()>
pub fn make_immutable( &mut self, scope_id: &str, name: &str, ) -> WorkflowResult<()>
Make a variable immutable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VariableEngine
impl RefUnwindSafe for VariableEngine
impl Send for VariableEngine
impl Sync for VariableEngine
impl Unpin for VariableEngine
impl UnsafeUnpin for VariableEngine
impl UnwindSafe for VariableEngine
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