Refine API for contexts.
This commit is contained in:
@@ -116,18 +116,20 @@ The function signature of an implementation is:
|
||||
|
||||
where:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| -------------------------- | :-----------------------------: | ------------------------------------------------------------------------------------- |
|
||||
| `context` | `&mut EvalContext` | mutable reference to the current evaluation _context_ |
|
||||
| • `scope()` | `&Scope` | reference to the current [`Scope`] |
|
||||
| • `scope_mut()` | `&mut Scope` | mutable reference to the current [`Scope`]; variables can be added to/removed from it |
|
||||
| • `engine()` | `&Engine` | reference to the current [`Engine`] |
|
||||
| • `source()` | `Option<&str>` | reference to the current source, if any |
|
||||
| • `imports()` | `&Imports` | reference to the current stack of [modules] imported via `import` statements |
|
||||
| • `iter_namespaces()` | `impl Iterator<Item = &Module>` | iterator of the namespaces (as [modules]) containing all script-defined functions |
|
||||
| • `this_ptr()` | `Option<&Dynamic>` | reference to the current bound [`this`] pointer, if any |
|
||||
| • `call_level()` | `usize` | the current nesting level of function calls |
|
||||
| `inputs` | `&[Expression]` | a list of input expression trees |
|
||||
| Parameter | Type | Description |
|
||||
| -------------------------- | :-------------------------------------: | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
| `context` | `&mut EvalContext` | mutable reference to the current evaluation _context_ |
|
||||
| • `scope()` | `&Scope` | reference to the current [`Scope`] |
|
||||
| • `scope_mut()` | `&mut &mut Scope` | mutable reference to the current [`Scope`]; variables can be added to/removed from it |
|
||||
| • `engine()` | `&Engine` | reference to the current [`Engine`] |
|
||||
| • `source()` | `Option<&str>` | reference to the current source, if any |
|
||||
| • `iter_imports()` | `impl Iterator<Item = (&str, &Module)>` | iterator of the current stack of [modules] imported via `import` statements |
|
||||
| • `imports()` | `&Imports` | reference to the current stack of [modules] imported via `import` statements; requires the [`internals`] feature |
|
||||
| • `iter_namespaces()` | `impl Iterator<Item = &Module>` | iterator of the namespaces (as [modules]) containing all script-defined functions |
|
||||
| • `namespaces()` | `&[&Module]` | reference to the namespaces (as [modules]) containing all script-defined functions; requires the [`internals`] feature |
|
||||
| • `this_ptr()` | `Option<&Dynamic>` | reference to the current bound [`this`] pointer, if any |
|
||||
| • `call_level()` | `usize` | the current nesting level of function calls |
|
||||
| `inputs` | `&[Expression]` | a list of input expression trees |
|
||||
|
||||
### Return Value
|
||||
|
||||
|
Reference in New Issue
Block a user